Hi Mariano

> - I open a connection (odbx_init and odbx_bind)
> - send a query which starts the transaction. This query depends on the
> database, but suppose something like "START TRANSACTION;"
> - insert something
> - close the connection (odbx_finish and odbx_unbind). Here I didn't do any
> commit or rollback.
> 
> Now, my question is, do the database client library finalize (rollback for
> example) all the opened transactions to the database done with that
> connection I am finalizing ? or do I explicitly rollback them ?
> What happen with the insert of this scenario ?
> Do this depends on the database client library ?

Yes, the database server (!) rolls back the transaction if the connection is 
closed or lost. The inserted record isn't committed to the storage. The 
firebird backend is a little bit different, as it needs to explicitly roll 
back open transactions.

> Do you think it is a good practice to explicitly rollback all opened
> transactions when closing a connection ?

No, not in Squeak as you don't know anything about the open transactions. In 
the case of firebird, leave that to the firebird backend.


Norbert
-- 
OpenPGP public key
http://www.linuxnetworks.de/norbert.pubkey.asc

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
libopendbx-devel mailing list
libopendbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libopendbx-devel
http://www.linuxnetworks.de/doc/index.php/OpenDBX

Reply via email to