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

SF.net SVN: ledger-smb:[3029] trunk/LedgerSMB.pm



Revision: 3029
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3029&view=rev
Author:   einhverfr
Date:     2010-07-22 16:46:04 +0000 (Thu, 22 Jul 2010)

Log Message:
-----------
Getting rid of 'Invalid Session' errors.

Modified Paths:
--------------
    trunk/LedgerSMB.pm

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2010-07-21 16:05:00 UTC (rev 3028)
+++ trunk/LedgerSMB.pm	2010-07-22 16:46:04 UTC (rev 3029)
@@ -292,7 +292,8 @@
         return 1;
     }
     my @vars = $self->call_procedure(procname => 'form_open', 
-                              args => [$self->{session_id}]
+                              args => [$self->{session_id}],
+                              continue_on_error => 1
     );
     if ($args->{commit}){
        $self->{dbh}->commit;
@@ -650,6 +651,7 @@
     my @call_args;
     @call_args = @{ $args{args} } if defined $args{args};
     my $order_by = $args{order_by};
+    my $query_rc;
     my $argstr   = "";
     my @results;
 
@@ -675,9 +677,15 @@
     $query =~ s/\(\)/($argstr)/;
     my $sth = $self->{dbh}->prepare($query);
     if (scalar @call_args){
-        $sth->execute(@call_args) || $self->dberror($self->{dbh}->errstr . ": " . $query);
+        $query_rc = $sth->execute(@call_args);
+        if (!$query_rc and !$args{continue_on_error}){
+              $self->dberror($self->{dbh}->errstr . ": " . $query);
+        }
     } else {
-        $sth->execute() || $self->dberror($self->{dbh}->errstr . ':' . $query);
+        $query_rc = $sth->execute();
+        if (!$query_rc and !$args{continue_on_error}){
+              $self->dberror($self->{dbh}->errstr . ':' . $query);
+        }
     }
    
     my @types = @{$sth->{TYPE}};


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