in reply to DBD Sybase Transaction begin_work fails

I think you need to decide if you want your transactions automatically committed or whether you are going to do it. i.e., leave AutoCommit as it is by default and start your transactions specifically with begin_work or disable AutoCommit and commit all transactions. You probably want the former as a) it allows you to control better where you specifically want transactions and b) some databases need commits in places you might be surprised - e.g., after a select.

  • Comment on Re: DBD Sybase Transaction begin_work fails

Replies are listed 'Best First'.
Re^2: DBD Sybase Transaction begin_work fails
by vcoderv (Initiate) on Sep 15, 2009 at 16:55 UTC
    I left AutoCommit -> 1, began transaction with $dbh -> begin_work right after connecting, prepared statement, and executed it: got this DBD::Sybase::st execute failed: Server message number=7713 severity=16 state=2 line=1 server=ETMA_NYDEV_DS text=Stored procedure 'PerlTest2' may be run only in unchained transaction mode. The 'SET CHAINED OFF' command will cause the current session to use unchained transaction mode. Issuing rollback() for database handle being DESTROY'd without explicit disconnect() at ./syb_test.pl line 28.