A table or row is locked by a person or a process. Another person/process wants to update the row.

The update statement is sent to the db but since the row is locked the update fails and throws a SQLException. I would like to catch this exception and if it is due to a lock, wait for x number of seconds and retry the update.

Once the first person has completed their update, the row is unlocked and the second person's update, which initially failed, will succeed.

This can easily be done programatically, but I don't want to have to change the code in 50-60 locations per application where an insert/update/delete occurs.

I was wondering if something like this was built into iBatis (or by extending a class I could do it).



Chris Lamey wrote:
Could you please provide more detail about what you're trying to do?  Is
this retry on exception or some kind of data condition?  Is this when
one record in a batch fails and you want to keep going?  What would
change that would cause a retry to succeed?

On Wed, 2006-08-30 at 09:20 -0500, Brad Balmer wrote:
Is there any built-in retry logic for inserts/updates? If not, does anybody have any ideas of the best way to implement this in a system that is already built and up and running?

We are using Spring with iBatis.

Thanks

___________________________
Brad Balmer
Application Architect
Peapod, Inc.
847-583-6306

This email may contain confidential or legally privileged information that is 
intended only for the individual or entity named as the recipient. If you are 
not the intended recipient, you are hereby notified that any disclosure, 
copying, distribution, or reliance upon the contents of this email is strictly 
prohibited. If you have received this email in error, please contact the sender 
so that proper delivery can be arranged, and then please delete this message. 
Thank you.



--

___________________________
Brad Balmer
Application Architect
Peapod, Inc.
847-583-6306

This email may contain confidential or legally privileged information that is 
intended only for the individual or entity named as the recipient. If you are 
not the intended recipient, you are hereby notified that any disclosure, 
copying, distribution, or reliance upon the contents of this email is strictly 
prohibited. If you have received this email in error, please contact the sender 
so that proper delivery can be arranged, and then please delete this message. 
Thank you.


Reply via email to