6.0.0-beta1
7/23/25

[#4891] api calls fail with postgres datatree without persistent connections
Summary api calls fail with postgres datatree without persistent connections
Queue Turba
Queue Version 2.1.3
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester stromsoe (at) gmail (dot) com
Created 01/14/2007 (6765 days ago)
Due
Updated 01/14/2007 (6765 days ago)
Assigned
Resolved 01/14/2007 (6765 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
01/14/2007 12:45:05 PM Jan Schneider State ⇒ Not A Bug
 
01/14/2007 11:49:44 AM stromsoe (at) gmail (dot) com Comment #2 Reply to this comment
You can close this.  I open a database connection in one of my hooks 
using the PEAR DB module and then call disconnect() at the end.  If I 
don't call disconnect() on the DB handle I open in my hook, all of the 
turba API calls work fine.
01/14/2007 09:04:34 AM stromsoe (at) gmail (dot) com Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ api calls fail with postgres datatree without persistent connections
Queue ⇒ Turba
Reply to this comment
When I run other horde applications that use the turba api calls, I 
end up with a blank screen.



php 5.2.0

apache 2.0.59

postgresql 8.2.0

horde, imp, kronolith, mnemo, nag, turba - all current stable



horde is configured with postgres for the datatree.

turba is also configured to use postgres for personal address books.



The bug triggers in IMP if I am viewing an email and click on the 
Notebook icon to add an email to address book.  It also triggers if I 
try to view an HTML attachment with images (the call to check if the 
sender is in the address book fails).



I've traced the bug as follows:



calls from Registry.php:



1. the registry function call() calls callByPackage()

2. callByPackage() calls pushApp() to push the application context

3. pushApp() calls hasPermission()

4. hasPermission() calls $GLOBALS['perms']->hasPermission()



calls from Perms/datatree.php



5. hasPermission() calls getPermissions()

6. getPermissions() calls getPermission()

7. getPermission() calls $this->_datatree->getObject()



calls from DataTree.php



8. getObject() calls getId() and feeds the results to getData() from 
DataTree/sql.php



calls from DataTree/sql.php



9. getData() calls $this->_db->getRow(), which fails and returns a 
PEAR_Error because the database connection no longer exists



10. immediately after the call to getRow(), 
Horde_Serialize::unserialize() is called with data from $row that 
doesn't exist and PHP bails with a blank screen.



There is no check for a Pear_Error after 9.



If I use persistent SQL connections I don't see this at all.  This is 
100% repeatable in my environment.

Saved Queries