[Dbix-class] Problem using DBIC in a Catalyst/mod_perl environment with multiple virtual hosts

Matt S Trout dbix-class at trout.me.uk
Thu Aug 24 20:02:02 CEST 2006


Andreas Dembach wrote:
> Matt S Trout wrote:
>> That's not really a problem as such. If you let the object go out of scope it 
>> goes out of scope :) if you don't do that you'll end up reconnecting all the 
>> time which is pretty gross. The reason you get the exceptions is because a 
>> live resultset doesn't keep the $schema in scope, since the alternative would 
>> be a circular reference and hence a memory leak.
>>
>>   
> OK, that's good news for us, if caching is no problem from your point of 
> view. Now that I understand what happens, I could construct our problem 
> in a little script:

Yes, we know. That's why I told you about it. There's even an rt.cpan ticket 
marked "rejected" with an explanation.

It's not easily fixable without putting the circular reference back in, and we 
don't have any great desire to release a version of DBIx::Class that leaks 
memory again, so for the mean time, please just hang onto the $schema, you 
need to do that anyway to make the DB connection persist.

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list