dmiller wrote:
>
> s1 = objectstore.get_session()
> s2 = s1.begin()
> # do stuff
> s1.commit() # ERROR: uncommitted nested sessions
> s2.commit() # not a real commit
> s1.commit() # commit all changes including those made on s2
> # do more stuff (all changes are now registered with s1)
> s2.commit() # ERROR: session expired - parent session has been committed
> s2 = s1.begin()
> # do stuff
> s2.commit() # ahh, that's better
> s1.commit() # yeah, now you're getting it
Does this require two "commit" calls for every "begin" ? thats a little
strange. also it doesnt really prevent the error from happening, does it
? they still can say:
def func(s):
s2 = s1.begin()
# do stuff
s2.commit() # save changes up to here
# do more stuff
s1.commit() # save the remaining changes
which still does the s1.commit() that is supposed to happen outside of
func() ? are we just looking for things that make it more visually
obvious where the begins/commits occur ?
how about "begin()/commit()" for the two-phase version and "commit_all()"
for the one-phase, so that theyre just totally separate ?
- mike
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users