yeah the name "commit()" is changing to "flush()" in 0.2. "commit" on the "objectstore" (which is also sort of going away) just writes changes to the database. it does use a transaction, but its opened and closed entirely within the flush() operation.

so if you want a real database transaciton to be open, yeah do it on the engine for now. 0.2 will have nicer ways to do it.


On Apr 25, 2006, at 8:50 PM, Brad Clements wrote:

sorry if this is a faq.

I want to use sqlalchemy in a Paste (wsgi) application.

For each web request, I need to begin a transaction, then either commit it or
rollback depending on wether an exception occurred.

I want the begin / commit / rollback will be handled by some wsgi middleware.

Looking at the latest online docs, I'm assuming that "begin" is implicitely handled
as needed by the engine.

And that if objectstore.commit() is not called, then the engine doesn't commit.

But then, neither will it rollback.. Right?

But depending on the concurency of the database, this may cause other clients to be blocked while they wait to see if I'm going to modify some data that has been
read from some table.

So, should I use engine.begin() , objectstore.commit() + engine.commit() and
engine.rollback() in the middleware instead?




--
Brad Clements,                [EMAIL PROTECTED]    (315)268-1000
http://www.murkworks.com
AOL-IM or SKYPE: BKClements




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel? cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to