Nur dann Transaktion starten, wenn noch keine läuft
authorMoritz Bunkus <moritz@bunkus.org>
Thu, 3 Feb 2011 10:44:19 +0000 (11:44 +0100)
committerMoritz Bunkus <moritz@bunkus.org>
Thu, 3 Feb 2011 10:44:19 +0000 (11:44 +0100)
SL/TransNumber.pm

index 0ba13a8..c9d7be6 100644 (file)
@@ -105,7 +105,7 @@ sub create_unique {
   my $form    = $main::form;
   my %filters = $self->_get_filters();
 
-  $self->dbh->begin_work;
+  $self->dbh->begin_work if $self->dbh->{AutoCommit};
   do_query($form, $self->dbh, qq|LOCK TABLE defaults|);
   do_query($form, $self->dbh, qq|LOCK TABLE business|) if $self->business_id;