in reply to Re: DBI lost connection errors
in thread DBI lost connection errors

++runig

This is the problem, I already found out the child processes automatically close the database connections of the parent but couldn't find a way to prevent this. Never noticed this attribute, but InactiveDestroy is the answer for this problem when using DBI and forking childs.

I've set the InactiveDestroy attribute to true on the parent's database handles and it runs smoothly now.

Thanks alot!

Replies are listed 'Best First'.
Re: Re: Re: DBI lost connection errors
by runrig (Abbot) on Jun 12, 2003 at 01:01 UTC
    I've set the InactiveDestroy attribute to true on the parent's database handles and it runs smoothly now.
    Did you read the part where it says InactiveDestroy should be set to true in the parent and false in the child, or vice-versa, but not true in both? If you are using the handle in the parent (and you usually should not fork and then use an existing handle in the child), then you should set it to false in the parent, fork, then set it to true in the child right after forking. Or you could set it to true, fork, then set it back to false in the parent right after forking.
      Yep I did,

      I set it to true right after the fork in the child. Don't think the child will 'die' just after the fork and before the first statement.

      Grtz Marcello