Announcement Announcement Module
Collapse
No announcement yet.
Selective Retries Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Selective Retries

    I have multi-user application that writes to database tables. At the start of each transaction, it locks the tables so other users can't write to them at the same time. Because of this design, a transaction may fail because another user temporarily has the table locked. But because the transactions typically only last a few seconds, locking problems go away on their own after a short period. Hence my thinking this is a good candidate for automatic retries.

    My challenge is that I want to do retries only if the failure is due to a table lock (& perhaps some other error types that indicate temporary problems). Is there a way to make Spring call a method I write that receives the database error & determines from it whether a retry should be attempted? I just discovered the Spring Batch today, so I'm hoping this capability is there and I just haven't found it yet. Can anyone point me to documentation & examples on how/if this can be done?

  • #2
    Originally posted by dadams07 View Post
    I have multi-user application that writes to database tables. At the start of each transaction, it locks the tables so other users can't write to them at the same time. Because of this design, a transaction may fail because another user temporarily has the table locked. But because the transactions typically only last a few seconds, locking problems go away on their own after a short period. Hence my thinking this is a good candidate for automatic retries.

    My challenge is that I want to do retries only if the failure is due to a table lock (& perhaps some other error types that indicate temporary problems). Is there a way to make Spring call a method I write that receives the database error & determines from it whether a retry should be attempted? I just discovered the Spring Batch today, so I'm hoping this capability is there and I just haven't found it yet. Can anyone point me to documentation & examples on how/if this can be done?
    possibly this may help as a starting point:
    http://static.springsource.org/sprin...tml#retryLogic

    Comment

    Working...
    X