retry

Rhino mocks ordered reply, throw exception problem

I'm trying to implement some retry logic if there is an exception in my code. I've written the code and now I'm trying to get Rhino Mocks to simulate the scenario. The jist of the code is the following: class Program { static void Main(string[] args) { MockRepository repo = new MockRepository(); ...

Best practices for handling a web service failure

In an Ajax web app, what do you do when a web service call from the browser to your server fails? Automatically retry, hoping it was an intermittent network failure or server error. (But when you have a real server issue, you may face further problems due to a multiplication of traffic from retries.) Fail, and show a message to the us...

PHP OO retry logic implementation and passing dynamic method and args

Hi all, My first question here. The question is similar to this one: http://stackoverflow.com/questions/712161/php-retrying-a-query-a-set-number-of-times-or-until-success Try till success in OO way. Here example what i'm trying to do: class Creatives { public function run() { $auth_token='mypassword'; $id=123123; $this->retry_til...

AXIS2 How to set connection retry??

It seems that the Axis admin client org.apache.axis2.client.ServiceClient is issuing org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry() and the retry is like 3 times by default. Is there a way to set to not do retries? My code: ServiceClient client = new ServiceClient(); Options opts = new Options(); ...

Why am i getting "error:1409F07F:SSL routines:SSL3_WRITE_PENDING: bad write retry" error while attempting an SSL_write?

See answer below ...

Automatic bookkeeping for exception retries

Do any languages that support retry constructs in exception handling track and expose the number of times their catch/rescue (and/or try/begin) blocks have been executed in a particular run? I find myself counting (and limiting) the number of times a code block is re-executed after an exception often enough that this would be a handy la...

Can a app engine task get a count of the number of times it's been run?

I am running thousands of tasks per hour in Google App Engine and around .1% of them are failing even after multiple retries. Ideally, I want them to stop trying and exit. However, due to app engine's design they seem to be just trying again and again. I know there is a backoff time which increases with every unsuccessful execution, but ...

PHP Retry Script until Success or Error

I'm trying to create a php script which retries another php script up to 3 times until an error is displayed. I'm thinking perhaps this could be done using a php loop? If the code works successfully the first time, then there is no need for it to retry 3 times, however, if it doesn't work the first time, then it should retry the php scri...

Automatic retry of failed connection in NHibernate

Is there a way to ask NHibernate to automatically retry failed connections to a database? Specifically, if my network connection is too unreliable, sometimes NH will fail to connect to my remote SQL Server. ...

Retries in Java printing?

if you run the following code(from http://www.javacommerce.com/displaypage.jsp?name=printcode.sql&id=18252), both pages are called twice class PrintObject implements Printable { public int print (Graphics g, PageFormat f, int pageIndex) { System.out.println("Page "+pageIndex); Graphics2D g2 = (Graphics2D) g; // Allow use of Java 2 g...

PHP Retry Script until Success or Error

Hi there, Thank you for taking the time to read this and I will appreciate every single response no mater the quality of content. :) I'm trying to create a php script which retries another php script up to 3 times until an error message is displayed. I'm thinking perhaps this could be done using a php loop? If the code works successful...

retry connection to rate limited URL until successful in Scala

I need make a GET call to a REST api which is rate limited. I can find out what the current rate limit is by making a call and checking the HTTP headers. If I've exceeded my rate limit, I should wait for a bit before retrying. I'd like to write something like: val conn = connect(url, _.getHeaderField("X-RateLimit-Remaining").toInt > 0, ...

file input retry

I want to input a file into an array, and if the file doesn't exist, the program exits. I have a lot of stuff to input from the command line, and if I make a typo the program exits and I have to enter it all again. How can I create an error message that keeps the program running, and lets me retry typing the file name right. FILE *fp; ...

three20 TTURLRequest resend

I have a REST service that uses an auth_token that expires every so often. when a request fails, I want to re-authenticate (which I'm able to do) and then resend the same exact TTURLRequest in the following generic way: - (void)request:(TTURLRequest*)request didFailLoadWithError: (NSError*)error { NSLog(@"error %@ %@ %@", [erro...

How to let NHibernate retry deadlocked transactions when using session per request?

What pattern/architecture do you use in a 3-tiered application using NHibernate that needs to support retries on transaction failures, when you are using the Session-Per-Request pattern? (as ISession becomes invalid after an exception, even if this is a deadlock or timeout or livelock exception). ...