[CDBI] Class:DBI::Loader, Net::Daemon, threads and... ewww... :)

[prev] [thread] [next] [Date index for 2005/09/26]

From: Mike Whitaker
Subject: [CDBI] Class:DBI::Loader, Net::Daemon, threads and... ewww... :)
Date: 18:21 on 26 Sep 2005
Here's one for you :)

Given a Net::Daemon daemon that basically talks to a DB, I'd  
obviously enough like Class::DBI::Loader to do the donkey work of  
reading in ****loads of tables just the once, not once per thread.

If I do that, and then hang the loader object off the Net::Daemon  
object such that each thread can fetch it, I get errors of the form:

DBD::mysql::db FETCH failed: handle 2 is owned by thread 814c008 not  
current thread 9698b50 (handles can't be shared between threads and  
your driver may need a CLONE method added) at /usr/share/perl5/Ima/ 
DBI.pm line 316, <GEN12> line 1.

OK. Fair enough. I'm probably being naughty. But is there a way of  
preserving the Class::DBI::Loader constructed relationships and  
hooking a new DBI handle on the back end?

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] Class:DBI::Loader, Net::Daemon, threads and... ewww... :)
Mike Whitaker 18:21 on 26 Sep 2005

Generated at 17:55 on 28 Sep 2005 by mariachi v0.52