<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Using SQL sessionhandler and SQL cache causes infinite recursion</title> 
  <pubDate>Fri, 10 Apr 2026 05:02:43 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/9282</link> 
  <atom:link rel="self" type="application/rss+xml" title="Using SQL sessionhandler and SQL cache causes infinite recursion" href="https://bugs.horde.org/ticket/9282/rss" /> 
  <description>Using SQL sessionhandler and SQL cache causes infinite recursion</description> 
 
   
   
  <item> 
   <title>Partial backtrace:

1	0.0016	795432	{main}( )	../config.ph</title> 
   <description>Partial backtrace:

1	0.0016	795432	{main}( )	../config.php:0
2	0.1231	2465768	Horde_Registry::appInit( )	../config.php:12
3	0.1231	2468832	Horde_Registry-&gt;__construct( )	../Registry.php:207
4	0.1495	3447712	Horde_Registry-&gt;setupSessionHandler( )	../Registry.php:415
5	0.1496	3449360	Horde_Injector-&gt;createInstance( )	../Registry.php:1657
6	0.1507	3488920	Horde_Core_Binder_SessionHandler-&gt;create( )	../Injector.php:261
7	0.1515	3544704	Horde_Core_Factory_Db-&gt;getDb( )	../SessionHandler.php:23
8	0.1516	3546296	Horde_Core_Factory_Db-&gt;getDb( )	../Db.php:86
9	0.1516	3547576	Horde_Core_Factory_Db-&gt;_createDb( )	../Db.php:91
10	0.1586	4322088	Horde_Injector-&gt;getInstance( )	../Db.php:155
11	0.1586	4322088	Horde_Injector-&gt;createInstance( )	../Injector.php:297
12	0.1595	4329016	Horde_Core_Binder_Cache-&gt;create( )	../Injector.php:261
13	0.1603	4362464	Horde_Core_Factory_Cache-&gt;getCache( )	../Cache.php:11
14	0.1734	4603584	Horde_Core_Factory_Db-&gt;getDb( )	../Cache.php:94
15	0.1735	4605000	Horde_Core_Factory_Db-&gt;getDb( )	../Db.php:86
16	0.1735	4606280	Horde_Core_Factory_Db-&gt;_createDb( )	../Db.php:91
17	0.1749	4633496	Horde_Injector-&gt;getInstance( )	../Db.php:155
18	0.1749	4633496	Horde_Injector-&gt;createInstance( )	../Injector.php:297
19	0.1750	4633544	Horde_Core_Binder_Cache-&gt;create( )	../Injector.php:261
20	0.1750	4634056	Horde_Core_Factory_Cache-&gt;getCache( )	../Cache.php:11
21	0.1750	4635968	Horde_Core_Factory_Db-&gt;getDb( )	../Cache.php:94
22	0.1751	4637384	Horde_Core_Factory_Db-&gt;getDb( )	../Db.php:86
23	0.1751	4638664	Horde_Core_Factory_Db-&gt;_createDb( )</description> 
   <pubDate>Sat, 02 Oct 2010 20:27:05 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9282#t60255</link> 
  </item> 
   
  <item> 
   <title>I think this has come up before (possibly within Horde_Db it</title> 
   <description>I think this has come up before (possibly within Horde_Db itself).  The solution is to add the logger to the object after creating it via a setLogger() call instead of in the constructor.</description> 
   <pubDate>Tue, 05 Oct 2010 17:05:08 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9282#t60272</link> 
  </item> 
   
  <item> 
   <title>Never mind... the cyclic dependency is that the SessionHandl</title> 
   <description>Never mind... the cyclic dependency is that the SessionHandler driver is using Db storage -&gt; the Db is creating a cache object to store things like Db schema info -&gt; the cache is stored in the Db itself.

Looks like we need some way to pass the cache object to the Db before it is instantiated.  I&#039;m guessing this might be a place to use injector/factories(?)</description> 
   <pubDate>Tue, 05 Oct 2010 17:34:48 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9282#t60273</link> 
  </item> 
   
  <item> 
   <title>Spent some time on this tonight and I&#039;m leaning toward the p</title> 
   <description>Spent some time on this tonight and I&#039;m leaning toward the problem being that logger and cache shouldn&#039;t be getting a full-fledged Horde_Db_Adapter, or that Horde_Db_Adapter shouldn&#039;t include logging and caching, but a higher-level object should. From the comments at http://misko.hevery.com/2008/08/01/circular-dependency-in-constructors-and-dependency-injection/:

@Peter,

here is how I would attack you problem.

class Database() implements DB;
class Logger(Database db);
class LoggingDatabase(Logger log, Database db) implements DB;

DB rawDatabase = new Database();
Logger log = new Logger(rowDatabase);
DB dbForTheRestoOfApplication = new LoggingDatabase(log, rowDatabase);

There you go. LoggingDatabase logs the commands as they go by and than delegate it on a class of the same interface. This is know as chain of responsibility and it is my favorite design pattern.

... so, that seems clean, but will take a little work.</description> 
   <pubDate>Sun, 16 Jan 2011 04:26:45 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9282#t61424</link> 
  </item> 
   
  <item> 
   <title>What about the idea I floated on dev@ about a &#039;queued&#039; Logge</title> 
   <description>What about the idea I floated on dev@ about a &#039;queued&#039; Logger instance?  On dev@ I was discussing the use of a queued logger during the time before the log object itself was available (e.g. before the Horde config could be parsed).  But a queued logger could likewise be used in this instance - log requests to the logger are queued until the logger can determine that the backend (the DB object) is fully initialized.</description> 
   <pubDate>Tue, 18 Jan 2011 05:57:17 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9282#t61447</link> 
  </item> 
   
  <item> 
   <title>I don&#039;t think that&#039;d work ultimately either. Horde_Db loggin</title> 
   <description>I don&#039;t think that&#039;d work ultimately either. Horde_Db logging queries when the logger is configured to log using Horde_Db is always going to create an infinite loop, even if we get past the object construction phase.</description> 
   <pubDate>Mon, 24 Jan 2011 01:34:35 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9282#t61553</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git for this ticket:

Bug #9282: W</title> 
   <description>Changes have been made in Git for this ticket:

Bug #9282: When creating Horde_Db objects, register them with a child injector before creating any dependencies that could in turn want a Horde_Db dependency.

http://git.horde.org/horde-git/-/commit/fa4fbb47bf73abd59ae6d690fb25594576acfe16</description> 
   <pubDate>Mon, 24 Jan 2011 03:34:40 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9282#t61554</link> 
  </item> 
   
  <item> 
   <title>Ultimately, I way overthought this. Works for me now.</title> 
   <description>Ultimately, I way overthought this. Works for me now.</description> 
   <pubDate>Mon, 24 Jan 2011 03:36:23 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9282#t61555</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
