On Jul 2, 6:37 am, Geoff <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm getting this exception: 'Lock wait timeout exceeded; try
> restarting transaction".

you shouldn't have transactions locking for so long that you're
getting such an error.  meaning, try not to have long-running
transactions open.

>
> I've looked through the docs and can't see if there is a way to get SA
> to retry itself rather than having to catch this exception and retry.

no, if you wanted to "retry" this is something youd have to do in your
own application code.  SA does not store a "history" of every
statement it issues within a transaction (not to mention all the
dependent operations around its statements) nor would it  ever want to
assume such behavior....since the error youre getting is generally
considered to be a failure despite its optimistic "try again" message.

if you really want to build around a "long running transactions" model
where "timeout" errors are expected, youd have to build a layer of
"heres the things i just did, now im doing them again" within your
application.

note that im not even sure every database even allows transaction
locks to timeout.  my experience with oracle and MS-SQL is that locks
are infinite until cancelled/killed (since it allows an administrator
to log in and see whats deadlocked).


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to