On Fri, 23 Jun 2006, Mark Hedges wrote:
> > 
> > I don't believe it's possible for them to share the same connection
> > safely under FastCGI, since it is multi-process, just like mod_perl with
> > the prefork MPM.  The DBIx::Class code never shares connections across
> > processes or threads.
> 
> My impression was it was different, and that it does some kind 
> of management for that, but I could be wrong. 
> 
> >From the man page:
> 
> "It has auto-increment support for SQLite, MySQL, PostgreSQL, 
> Oracle, SQL Server and DB2 and is known to be used in production 
> on at least the first four, and is fork- and thread-safe out of 
> the box (although your DBD may not be)."

I was wrong about DBIx::Class.  All this means is, that if you 
connect in startup, then children fork/spawn, DBIx::Class 
detects that and automatically reconnects with a fresh handle.

There is some work on other mechanisms, if you search on CPAN 
for "DBI pool".  The DBI roadmap document has this to say:

"* Connection pooling in a threaded application, such as 
mod_perl, is difficult because DBI handles cannot be passed 
between threads. An alternative mechanism for passing 
connections between threads has been defined, and an 
experimental connection pool module implemented using it, but 
development has stalled."

Until then, number of workers/threads == number of DBI handles.

Mark

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to