On Mon, Jul 01, 2002 at 02:52:22PM +0200, Gerald Richter - ecos gmbh wrote: > > > > Each thread using the DBI directly must have it's own DBI instance, > > either loaded itself or cloned from parent thread, because handles > > can't be shared or passed across threads or between parent and child. > > So each threads needs to have it's own connection to the database. > > Are you really sure? Doesn't this depend on the underling driver library? > Why shouldn't it possible to have just one connection to the database and > use it by many threads, if the driver supports this? Isn't this one of the > reasons why threads are there, to share resources easily? (and to reduce the > number of needed licences, if you have to licence per connection)
It may be possible but only by having objects in one thread hold pointers to data owned but another thread (in another interpreter). That's not good. For the short term (and possibly medium term) I think we need to be more restrictive than that. If only for our own sanity. > The ability to share handles, is one of the reason to use > threads, isn't it? It would certainly be nice - but very hard to get right and safe. > I like to get more clearance here before we go into implementation details If you can think of a safe way to do it then I'm all ears. But I'd still urge you to get the rest of the groundwork in place asap (ideally before the perl conference in a couple of weeks time - then I can put your name up in lights :) Tim.