Hi! thanks for replying :)

I agree that transactions shouldn't be timing out, the problem happens
when we do a database dump, this locks all the tables for a while and
it happens once a day.

I think I'll go fix it at the source rather than handling it in the
code - i.e. find another way of dumping the database which doesn't
take so long  and / or increase the timeout on the mysql server...

Cheers :)




On Jul 2, 3:17 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> 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