1--- DBIx-Class/lib/DBIx/Class/Storage/DBI.pm  (revision 9463)
2+++ DBIx-Class/lib/DBIx/Class/Storage/DBI.pm  (working copy)
3@@ -1200,12 +1200,19 @@
4 
5 sub txn_commit {
6   my $self = shift;
7-  if ($self->{transaction_depth} == 1) {
8+  # if ($self->{transaction_depth} == 1) {
9+  if (($self->{transaction_depth} == 1) or (!$self->_dbh_autocommit and $self->{transaction_depth} > 1)) {
10     $self->debugobj->txn_commit()
11       if ($self->debug);
12     $self->_dbh_commit;
13-    $self->{transaction_depth} = 0
14-      if $self->_dbh_autocommit;
15+    # $self->{transaction_depth} = 0
16+    #   if $self->_dbh_autocommit;
17+		if ( $self->_dbh_autocommit ) {
18+			$self->{transaction_depth} = 0;
19+		}
20+		else {
21+			$self->{transaction_depth}--;
22+		}
23   }
24   elsif($self->{transaction_depth} > 1) {
25     $self->{transaction_depth}--;
26