in reply to commtting db transactions

I am little confused about original environment since MySQL does not support native commit and rollback. So has the original pre-port code got a lot of 'simulated' commit and rollback code ??

That being said here are a couple things to ponder that may help.

It is common in DBI to wrap transactions in eval. You may already know this but I state the obvious just in case :)

eval { do some transcations $dbh->commit() }; $dbh->rollback() if $@;
Also DB2 supports 4 transaction isolation levels: Repeatable Read, Cursor Stability(default), Read Stabilty, Uncommited Read. The good news is these may help to simplify transcations. Bad news DBD::DB2 supports this through an external variable TXNISOLATION found in db2cli.ini. It cannot be changed in SQL so you only get one choice and it is globally applied across your entire database.

Hope this may give you some ideas. Good Luck.

mitd-Made in the Dark
'My favourite colour appears to be grey.'

Replies are listed 'Best First'.
Re: Re: commtting db transactions
by d_i_r_t_y (Monk) on Aug 09, 2001 at 18:32 UTC
    I am little confused about original environment since MySQL does not support native commit and rollback. So has the original pre-port code got a lot of 'simulated' commit and rollback code ??

    not true, transactions were introduced in version 3.23. so, surprising as it is, we did indeed have real transactions with mysql ;-) the only 'trick' is that we had to use the $dbh->do('begin'); ... ; $dbh->do('commit'); syntax rather than the begin and commit methods per se.

    d_i_r_t_y