[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[6600] trunk



Revision: 6600
          http://sourceforge.net/p/ledger-smb/code/6600
Author:   einhverfr
Date:     2014-01-23 05:09:54 +0000 (Thu, 23 Jan 2014)
Log Message:
-----------
Since we got rid of the db commits, duplicate dbh's tend to lock.  Correcting this when old code redirects to new code.  Will fix the other way too.

Modified Paths:
--------------
    trunk/LedgerSMB/Session.pm
    trunk/LedgerSMB.pm
    trunk/bin/gl.pl
    trunk/lsmb-request.pl

Modified: trunk/LedgerSMB/Session.pm
===================================================================
--- trunk/LedgerSMB/Session.pm	2014-01-23 03:33:52 UTC (rev 6599)
+++ trunk/LedgerSMB/Session.pm	2014-01-23 05:09:54 UTC (rev 6600)
@@ -33,6 +33,8 @@
 
 sub check {
     my ( $cookie, $form ) = @_;
+    use Carp::Always;
+    warn $cookie;
 
     my $path = ($ENV{SCRIPT_NAME});
     $path =~ s|[^/]*$||;

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2014-01-23 03:33:52 UTC (rev 6599)
+++ trunk/LedgerSMB.pm	2014-01-23 05:09:54 UTC (rev 6600)
@@ -624,8 +624,8 @@
 
 sub finalize_request {
     LedgerSMB::App_State->cleanup();
-    die; # return to error handling and cleanup
-         # Without dying, we tend to continue with a bad dbh. --CT
+    die 'exit'; # return to error handling and cleanup
+                # Without dying, we tend to continue with a bad dbh. --CT
 }
 
 # To be replaced with a generic interface to an Error class
@@ -676,10 +676,10 @@
     if (!$self->{company}){ 
         $self->{company} = $LedgerSMB::Sysconfig::default_db;
     }
-
-    $self->{dbh} = LedgerSMB::DBH->connect($self->{company})
-      || LedgerSMB::Auth::credential_prompt;
-
+    if (!($self->{dbh} = LedgerSMB::App_State::DBH)){
+        $self->{dbh} = LedgerSMB::DBH->connect($self->{company})
+            || LedgerSMB::Auth::credential_prompt;
+    }
     LedgerSMB::App_State::set_DBH($self->{dbh});
     LedgerSMB::App_State::set_DBName($self->{company});
 

Modified: trunk/bin/gl.pl
===================================================================
--- trunk/bin/gl.pl	2014-01-23 03:33:52 UTC (rev 6599)
+++ trunk/bin/gl.pl	2014-01-23 05:09:54 UTC (rev 6600)
@@ -116,7 +116,6 @@
     $lsmb->merge($form);
 
     my $draft = LedgerSMB::DBObject::Draft->new({base => $lsmb});
-
     $draft->approve();
     if ($form->{callback}){
         print "Location: $form->{callback}\n";

Modified: trunk/lsmb-request.pl
===================================================================
--- trunk/lsmb-request.pl	2014-01-23 03:33:52 UTC (rev 6599)
+++ trunk/lsmb-request.pl	2014-01-23 05:09:54 UTC (rev 6600)
@@ -116,7 +116,7 @@
       # -- CT
      $LedgerSMB::App_State::DBH->rollback if ($LedgerSMB::App_State::DBH and $_ eq 'Died');
      LedgerSMB::App_State->cleanup();
-     $request->_error($_) unless $_ =~ 'Died at';
+     $request->_error($_) unless $_ =~ 'Died at' or $_ eq 'exit';
   };
 }
 1;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits