Added infrastructure to support transactions in ::DBI, but turned it off (for now)
[dbsrgits/DBM-Deep.git] / lib / DBM / Deep / Storage / DBI.pm
index 819e3cd..8cb9c02 100644 (file)
@@ -49,7 +49,7 @@ sub open {
 
     $self->{dbh} = DBI->connect(
         $self->{dbi}{dsn}, $self->{dbi}{username}, $self->{dbi}{password}, {
-            AutoCommit => 0,
+            AutoCommit => 1,
             PrintError => 0,
             RaiseError => 1,
             %{ $self->{dbi}{connect_args} || {} },
@@ -92,6 +92,21 @@ sub unlock {
     $self->{dbh}->commit;
 }
 
+sub begin_work {
+    my $self = shift;
+    $self->{dbh}->begin_work;
+}
+
+sub commit {
+    my $self = shift;
+    $self->{dbh}->commit;
+}
+
+sub rollback {
+    my $self = shift;
+    $self->{dbh}->rollback;
+}
+
 sub read_from {
     my $self = shift;
     my ($table, $cond, @cols) = @_;