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

use Perl Log In

Log In

[ Create a new account ]

djberg96 (2603)

djberg96
  (email not shown publicly)

Journal of djberg96 (2603)

Thursday February 14, 2002
04:54 PM

Finally!

[ #2875 ]
This one had me seriously stressed out...

Co-worker changed some code. Code suddenly stops working correctly, but for no apparent reason. Error log didn't make any sense - different stopping point each time. Then finally, it dawned on me...

Little safety tip - create database handles after you do your forking & stuff when working with Oracle. :)

I'd slap him for moving that line, but then it's partially my own fault for not putting a comment about it in there.

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.
    • In Slash, we connect with DBI before Apache forks, cache some data and do whatever we need to do in the parent process, kill the DBI handle, and then reopen a new DBI handle in each child.
    • 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 at

      • 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.