[svn:p5ee] r9764 - p5ee/trunk/App-Repository/lib/App/Repository

[email protected]
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
Author: spadkins
Date: Wed Jul 18 11:36:43 2007
New Revision: 9764

Modified:
   p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm

Log:
fix some more things with begin_work/commit/rollback

Modified: p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm	(original)
+++ p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm	Wed Jul 18 11:36:43 2007
@@ -199,8 +199,8 @@
             }
         }
         die "Can't connect to database" if (!$self->{dbh});
+        delete $self->{in_transaction};
     }
-    delete $self->{in_transaction};
 
     &App::sub_exit(defined $self->{dbh}) if ($App::trace);
     return(defined $self->{dbh});
@@ -285,6 +285,7 @@
         my $dbh = $self->{dbh};
         $dbh->disconnect;
         delete $self->{dbh};
+        delete $self->{in_transaction};
     }
     &App::sub_exit(1) if ($App::trace);
     1;
@@ -296,6 +297,7 @@
     if ($self->{dbh}) {
         $self->{dbh}{InactiveDestroy} = 1;
         delete $self->{dbh};
+        delete $self->{in_transaction};
     }
     &App::sub_exit(1) if ($App::trace);
     1;
@@ -2488,6 +2490,7 @@
 sub begin_work {
     &App::sub_entry if ($App::trace);
     my $self = shift;
+    $self->_connect();
     if (!$self->{in_transaction}) {
         $self->{dbh}->begin_work();
         $self->{in_transaction} = 1;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.