5.3.0-git
2014-08-29

[#11923] Transaction issues with ajax.php
Summary Transaction issues with ajax.php
Queue Horde Base
Queue Version 5.0.2
Type Bug
State Resolved
Priority 2. Medium
Owners jan (at) horde (dot) org
Requester it (at) wenn (dot) com
Created 2012-12-28 (609 days ago)
Due
Updated 2013-10-14 (319 days ago)
Assigned 2013-01-09 (597 days ago)
Resolved 2013-10-14 (319 days ago)
Milestone
Patch No

History
2013-10-14 13:19:49 Jan Schneider Comment #8
State ⇒ Resolved
Assigned to Jan Schneider
Reply to this comment
This still doesn't make any sense, because we explicitly check if we 
have open transactions before working on them.
Another issue is that we let a PDOException raise, so that it's not 
catched by the session handler storage backend. This is fixed for 
Horde_Db 2.1.0, so at least you shouldn't get this error anymore.
2013-10-14 13:18:14 Git Commit Comment #7 Reply to this comment
Changes have been made in Git (master):

commit 056a1c975aa0546731ff451a573419b82302f506
Author: Jan Schneider <jan@horde.org>
Date:   Mon Oct 14 15:17:28 2013 +0200

     [jan] Always re-throw PDOExceptions as Horde_Db_Exceptions.

     Related to bug #11923.

  framework/Db/lib/Horde/Db/Adapter/Pdo/Base.php |   44 ++++++++++++++++++-----
  framework/Db/package.xml                       |    2 +
  2 files changed, 36 insertions(+), 10 deletions(-)

http://git.horde.org/horde-git/-/commit/056a1c975aa0546731ff451a573419b82302f506
2013-10-04 10:41:14 it (at) wenn (dot) com Comment #6 Reply to this comment
Ping?
after upgrading to horde 5.1.4 from 5.1.2 I am getting this problem
[Thu Oct 03 16:49:42 2013] [error] [client 10.0.0.5] PHP Fatal error:   
Uncaught exception 'PDOException' with message 'There is no active 
transaction' in 
/home/httpd/devel/webmaildev.wenn.com/htdocs/pear/php/Horde/Db/Adapter/Base.php:655
Stack trace:
#0 
/home/httpd/devel/webmaildev.wenn.com/htdocs/pear/php/Horde/Db/Adapter/Base.php(655)
PDO->commit()
#1 
/home/httpd/devel/webmaildev.wenn.com/htdocs/pear/php/Horde/SessionHandler/Storage/Sql.php(77)
Horde_Db_Adapter_Base->commitDbTransaction()
#2 
/home/httpd/devel/webmaildev.wenn.com/htdocs/pear/php/Horde/SessionHandler.php(150)
Horde_SessionHandler_Storage_Sql->close()
#3 [internal function]: Horde_SessionHandler->close()
#4 
/home/httpd/devel/webmaildev.wenn.com/htdocs/pear/php/Horde/SessionHandler.php(115)
session_write_close()
#5 [internal function]: Horde_SessionHandler->__destruct()
#6 {main}\n  thrown in 
/home/httpd/devel/webmaildev.wenn.com/htdocs/pear/php/Horde/Db/Adapter/Base.php on line 655, referer: 
http://webmaildev.wenn.com/login.php?horde_logout_token=SXXGaJcUbg9rVclYgmcDXA9&logout_reason=4


2013-04-17 13:03:37 Jan Schneider State ⇒ No Feedback
 
2013-04-03 11:16:58 Jan Schneider Comment #5 Reply to this comment
Ping?
2013-01-10 00:10:38 it (at) wenn (dot) com Comment #4 Reply to this comment
So, I guess the question is - why are there remaining transactions 
when closing the connection?
Indeed, this i do not know, last time i looked on the old ticket i got 
stuck in the Storage Stack code.

When i have some time ile have to put some debug backtrace or 
error_log commands out to a log and analize what is happening unless 
anyone has any better ideas on how to do this.
2013-01-09 23:06:58 Michael Rubinsky Comment #3
Priority ⇒ 2. Medium
State ⇒ Feedback
Reply to this comment
So, I guess the question is - why are there remaining transactions 
when closing the connection?
2012-12-28 18:03:36 it (at) wenn (dot) com Comment #2 Reply to this comment
#pear/php/Horde/Db/Adapter/Base.php"

     /**
      * Reconnect to the db.
      */
     public function reconnect()
     {
         $this->disconnect();
         $this->connect();
     }

     /**
      * Disconnect from db.
      */
     public function disconnect()
     {
         $this->_connection = null;
         $this->_active = false;
     }

On disconnect or reconnect all transactions are voided on the DB, the 
transaction counter should be reset acordingly by adding the following 
to the end of the disconnect function.

         $this->_transactionStarted=0;
2012-12-28 17:10:39 it (at) wenn (dot) com Comment #1
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Base
Summary ⇒ Transaction issues with ajax.php
Type ⇒ Bug
Priority ⇒ 3. High
Reply to this comment
There seems to be an issue with all ajax calls and the transaction 
handler for PDO.
The last time i had an issue with transactions it was related to 
#10978 but seems that was resolved.

[Fri Dec 28 16:28:30 2012] [error] [client 79.123.35.132] PHP Fatal 
error:  Uncaught exception 'PDOException' with message 'There is no 
active transaction' in 
/home/httpd/live/example.com/htdocs/pear/php/Horde/Db/Adapter/Base.php:655
Stack trace:\n#0 
/home/httpd/live/example.comm/htdocs/pear/php/Horde/Db/Adapter/Base.php(655)
PDO->commit()
#1 
/home/httpd/live/example.comhtdocs/pear/php/Horde/SessionHandler/Storage/Sql.php(77): 
Horde_Db_Adapter_Base->commitDbTransaction()
#2 
/home/httpd/live/example.com/htdocs/pear/php/Horde/SessionHandler/Storage/Stack.php(79)
Horde_SessionHandler_Storage_Sql->close()
#3 
/home/httpd/live/example.com/htdocs/pear/php/Horde/SessionHandler.php(154)
Horde_SessionHandler_Storage_Stack->close()
#4 [internal function]: Horde_SessionHandler->close()
#5 
/home/httpd/live/example.com/htdocs/pear/php/Horde/SessionHandler.php(117)
session_write_close()
#6 [internal function]: Horde_SessionHandler->__destruct()
#7 {main}\n  thrown in 
/home/httpd/live/example.com/htdocs/pear/php/Horde/Db/Adapter/Base.php 
on line 655

At the moment ive had to revert to memcached as the backend for 
session tracking instead of PDO as it seems to work fine but ultimatly 
this is not a solution.