in reply to Error Using Multiple Database Handles (DBD::Oracle::db do failed: handle 2 is owned by thread...)

I think the DBI/DBD checks if a method is being called from the same thread or process that the respective handle was created in (see the docs). In other words, it croaks in your case, because the do method is being called from a cloned/forked process as created by Parallel::ForkManager...

You probably need to create a pool of persistent processes (or threads) and open the handles after having forked. Then delegate your queries to the appropriate processes in the pool.

  • Comment on Re: Error Using Multiple Database Handles (DBD::Oracle::db do failed: handle 2 is owned by thread...)
  • Download Code