[CDBI] transactions with class dbi

jvanhan jvanhan at gmail.com
Fri Mar 17 13:32:09 GMT 2006

Hello All,

I am new to CDBI and am having troubles with transactions. There must be
something simple that I am overlooking because the samples do not seem to

I am using MySQL 4.1.11 as my database.

My Global Class DBI looks like:

package myDB::DBI;
use base 'Class::DBI';
use myDB::connParam;

my $cp = myDB::connParam->new;

__PACKAGE__->connection('dbi:mysql:mydb',$cp->user,$cp->pass,{AutoCommit =>


in my testing code which goes through cgi I have


use CGI::Carp qw(fatalsToBrowser);
use CGI;
use strict;
use myDB::study;

my $cgi = new CGI;
print $cgi->header();

my $study = myDB::study->create({
    name=> "name",
    detail => "datail",
    description => "is there life on mars?"}


This rollback does not happen although the autocommit property is set to 0.
So the data end up in the database anyway.

Any help would be much appreciated.

Thanks a bunch,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digitalcraftsmen.net/mailman/private/classdbi/attachments/20060317/f81c7898/attachment.htm

More information about the ClassDBI mailing list