On Tue, 2005-03-15 at 19:40 -0500, jonathan vanasco wrote:
> On Mar 15, 2005, at 7:30 PM, Perrin Harkins wrote:
> 
> > Don't fork with an open database connection and then try to use it.  It
> > will not work.
> 
> Really?  I figured that it  would work just right -- except whatever 
> you programmed to use that will crash and burn and time out waiting to 
> access the single shared handle.

That would imply that there's built-in mechanism for sharing things
safely between processes.  There isn't.

There are things in DBI to catch this mistake now, which will give you
an error messages about PIDs not mathcing.  Before, it would have just
given you crazy messages about socket errors and incorrect results.

> I should have explained that I was just trying to illustrate the 
> concept , should I ?

Okay, but copy-on-write sharing is a transparent process that has no
effect on the behavior of your program.  It isn't the same as processes
cooperating to avoid concurrent use of the same database handle, like
you describe above.

I just want to make it very clear to people that they should not fork
with an open db handle and then try to use it.

- Perrin

Reply via email to