[CDBI] Forking and reconnecting to the database

Matt S Trout dbix-class at trout.me.uk
Tue Mar 7 20:13:31 GMT 2006

Aaron Trevena wrote:
> Hi all,
> I've been reading about how to handle CDBI classes when forking and am
> struggling to get a grasp of the picture - naturally, there's no clear
> explaination in the cdbi or Ima::DBI docs anywehere, so I have found
> pieces of the puzzle like :
> http://www.spanner.org/lists/cdbi/2005/11/07/eb3bb63e.html
> .. which explains that I need a new connection after forking and using
> $dbh->{InactiveDestroy}, but it looks like I need subclass the
> connection methods of either Ima::DBI or Class::DBI and thats more
> work and less documentation that i'd really like.

You could always template a solution off the internals of 
DBIx::Class::Storage::DBI, which is already basically fork-proof (although 
admittedly not yet thread-proof as well ...)

More information about the ClassDBI mailing list