Rollback, hey Sybase

Some of you probably wondering why even if you set AutoCommit to 0, the data is still committed when you use DBD::Sybase in perl to access Sybase. Looks like the solution is to add syb_chained_txn to 1 like this:


use DBI;
my $dbh = DBI->connect("dbi::Sybase::server=$server", $username, $password,
{'RaiseError' =>1, 'AutoCommit' =>0}) or
die ("Database connection no made ". DBI::errstr);
$dbh->{syb_chained_txn} = 1;

Now Sybase will rollback at your command!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s