Kent wrote:
[SNIP]
> I'm fine with how SQLA is designed, it isn't really a SQLA 
> issue, I was 
> just appealing to you to see if you could think of a workaround   I 
> believe the problem is in the framework tools we are using, 
> whether it 
> is Zope or TG.  (I've posted to zope group now to see if they 
> intended 
> to support savepoints and how, etc.).
> Since that framework won't allow me to issue the command 
> session.commit(), I cannot release the savepoints until the zope 
> transaction commits, and by then I'm getting a python max recursion 
> problem because there are so many outstanding savepoints for 
> it to release.

>From a quick reading of the 'transaction' package source, it looks like
you should be able to create savepoints and roll them back something
like this:

savepoint = transaction.savepoint()
try:
   # ...
except:
   savepoint.rollback()
   raise

I've no idea if that will confuse SA's accounting mechanisms though - I
imagine you'd probably need to clean up some objects in the session.

If you have a look at the tg.configuration module, the transaction
middleware is added based on the config.use_transaction_manager value,
so you could set that to False and implement whatever transaction
management features you want in your own middleware.

Hope that helps,

Simon

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

Reply via email to