On 5/30/2010 1:24 PM, Michael Bayer wrote:
On May 28, 2010, at 1:46 PM, Kent Bower wrote:

On 5/28/2010 10:08 AM, Michael Bayer wrote:
Is the pattern that you want to keep re-issuing a savepoint repeatedly using 
the same name ? Does that have some different usage of resources versus 
issuing/closing distinct savepoints with different names ?

As an aside, since oracle apparently has no 'release savepoint', I imagine the answer to 
your second question might be: "yes, when using oracle with thousands of potential 
savepoints."    I think I've worked around this for now, so I'm not asking you to 
necessarily do anything about it, but it might be somewhat of a minor enhancement at some 
point.
Thanks again.

just so we're on the same page, oracle has no release, so if we are doing this:

begin_nested()
commit()
begin_nested()
commit()
begin_nested()
commit()


the ora conversation is

SAVEPOINT x
SAVEPOIINT y
SAVEPOINT z

i.e. cheaper to reuse the same savepoint since we aren't rolling back to "y" or 
"x".

in engine/base.py, seems like we would add logic to the "__savepoint_seq" 
counter to achieve this.
I think that is what I was driving at. May/should be better with oracle (though I admit to not knowing how expensive a savepoint is, certainly if you've got thousands outstanding it would have been better to reissue the same one under the circumstances that it had already been 'released' with commit()).

Although sqla doesn't allow the user to specify the savepoint name, the same could be accomplished given if support for the following were implemented:

Let me ask:

sp_a=begin_nested()
...
...
sp_b=begin_nested()
...
...
sp_c=begin_nested()
...
... #realize I need to go back to sp_a...
sp_a.rollback()

My understanding from the docs, is this is no good currently. I need to first do commit(), commit() and then rollback() or three rollback()s, correct?

Again, I'm not requesting an enhancement, but would make the point that it would be more *intuitive* for sqla to figure that out for you, so you could arbitrarily say sp_a.rollback() and it knows to release or rollback all the nested transactions living under sp_a.

Kent





--
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