On Apr 13, 2007, at 12:11 AM, Perrin Harkins wrote:
> My guess is that your code connects to the database from the parent
> process in order to do auto-discovery of the tables, and then you end
> up sharing the same handle when apache forks. Apache::DBI does
> prevent this, so you might consider using that instead, or else add $$
> to your dbh key. Most of what you have here is covered by either
> Apache::DBI or DBI->connect_cached, except that alarm part.
Personally , I handle this all with a Factory pattern.
RDBO has a purposefully bad connect string internally, and the init
function on objects pulls a dbh from a factory.
The factory deals with connections/caches itself.
Under MP:
prefork the factory only gives out readonly config handles
postfork the factory gives out read / write handles
All my transactions are handled by communicating with the factory --
telling it to begin/rollback/commit. I use my own version of DB
handles that are similar to DBIx-Transaction -- the big difference is
that i overload connect and disconnect to become their own nested
transaction blocks.
// Jonathan Vanasco
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
| SyndiClick.com
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
| FindMeOn.com - The cure for Multiple Web Personality Disorder
| Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
| RoadSound.com - Tools For Bands, Stuff For Fans
| Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/rose-db-object