On Apr 3, 2006, at 8:51 PM, Gambit wrote:

If this is accurate, a couple questions spring to mind:
First, when you do session.flush() without a surrounding transaction, does
all the UOW actual commits occur within it's own transaction? (I sorta
assumed this is yes, but just want to make sure)


yes

Second, I assume that foo, bar, and baz above all "belong" to the new
session. What about other instances, created before or after? I think I'm
trying to determine if the concept of "ownership" applies to session
objects, or if they're just container/trackers for the UOW concept, and as such any changes that occur within their scope of authority are managed by
them.


object instances do "belong" to specific Session instances, yes. multiple sessions can share the same "identity map" though so in that way an object can be relevant to more than one Session at a time.

Third, it seems like we're migrating away from using the objectstore for anything other then Session management. Not trying to break too many api's
here, but maybe we should change our references to
sqlalchemy.current_session instead of sqlalchemy.objectstore?


um yah thats a possibly decent idea, it would just involve loading some symbols into the base package

Forth, and finally, I'm not sure that session.begin_transaction() should create a SQLTransaction as well (which, if I understand correctly, is what a engine.begin() does -- an honest to goodness transaction). Isn't the
idea of the session.begin_transaction() something to establish UOW
transactions, not DB transactions? Or am I just completely reading that
wrong?


heh...well, sure that would be great, then i dont have to change so much. it just seems like everyone is universally expecting the "begin ()" and "commit()" keywords, no matter where they are called from , to establish real database transactions. which I cant say is entirely unreasonable. it was my mistake to create two different concepts and use the same words for them. I think a UOW "transaction" should be called something different, so i dont have to keep trying to explain the difference between them.



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to