On Apr 15, 2009, at 4:33 AM, Sibylle Koczian wrote: >> exucute() isn't a Dabo method, it's from kinterbasdb, so there is no >> startTransaction parameter. You have to do it yourself. > > But the tempCursor has execute(), beginTransaction(), > commitTransaction(), rollbackTransaction() - Dabo methods or not?
execute() is indeed a Dabo method. It wraps the dbapi's execute() method, and adds some additional functionality. > And there is dBizobj.executeSafe, which "uses an auxiliary cursor". > Where is > the difference between using that and using getTempCursor()? This is one area where our naming is poor. It should really be _executeSafe(), to indicate that it is an internal implementation. It should not be called in your code. getTempCursor() is a convenience method to allow you to get an object for direct connections to the database, but with all of the additional features that Dabo adds. Since running a query on an existing cursor wipes out its current dataset, a temp cursor is used in cases where you need to grab some additional data, but want to preserve the current data managed by the bizobj. >> To keep Dabo from messing with the current transaction you will >> have to >> use Dabos _getTransactionToken(), _releaseTransactionToken() methods. > > But shouldn't the methods mentioned above manage the current and the > new > transaction correctly, without me using internals? You don't. You can call cursor.beginTransaction(), etc., directly, if you are sure that you are not ever going to be executing this code in the middle of another process that would be need to be wrapped in a transaction, such as in the middle of a save(). Your code would look like: crs = bizobj.getTempCursor() #probably not needed, but it won't hurt crs.beginTransaction() crs.execute(<your SP>) crs.commitTransaction() -- Ed _______________________________________________ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/003cc72c-66ba-4e10-a8ec-f6fa91b45...@leafe.com