Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • DBI handles just don't survive a fork. The database server doesn't matter.
    • Re:With any database (Score:1, Informative)

      by djberg96 (2603) on 2002.02.15 15:25 (#4601) Journal
      Actually, it *is* RDMS specific, at least that's what the docs indicate. I've only ever used DBI with Oracle. From the DBI docs (note the italicized part):

      InactiveDestroy (boolean)

      This attribute can be used to disable the database engine related effect of DESTROYing a handle (which would normally close a prepared statement or disconnect from the database etc). For a database handle, this attribute does not disable an explicit call to the disconnect method, only the implicit call from DESTROY.

      This attribute is specifically designed for use in Unix applications that ``fork'' child processes. Either the parent or the child process, but not both, should set InactiveDestroy on all their shared handles. Note that some databases, including Oracle, don't support passing a database connection across a fork.

      Doesn't work with Threads either (tried it in Ruby).

      • And it doesn't work with MySQL. I think I've seen this problem with Postgres too.

        I haven't tried it with any others.

        At the very least, its not Oracle specific and I'd expect to fail more often than not.