Feb 22nd, 2010, 02:06 PM
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?
Feb 24th, 2010, 09:06 AM
possibly this may help as a starting point:
Originally Posted by dadams07