[Twisted-Python] Transactions with SQLReflector.
dave at krondo.com
Wed Aug 20 14:51:45 EDT 2003
On Wed, 2003-08-20 at 11:12, Manuel Duran Aguete wrote:
> I need transactions usign SQLReflector. How can I ativate this ?
> Basically I have an array of rowObjects and I want to insert all of
> them in a database table, but all in a transaction, and rollback if an
> error occurrs.
There isn't an automatic way to do this, but what you can
do is, instead of using sqlreflector.InsertRow(...), use
sqlreflector.InsertRowSQL(...) to build the sql calls to
do this, and then execute them all with the same cursor
using the connection pool's runInteraction method.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20030820/362fc801/attachment.pgp
More information about the Twisted-Python