[pm-h] Perl tie variable to database then using local on it

Michael R. Davis mrdvt92 at yahoo.com
Thu Aug 1 15:17:27 PDT 2013


Perl Folks,
 > Has anyone attempted to tie a variable to Oracle's v$session values? Or any database value for that matter?
> DBD::Oracle::db DESTROY failed: ORA-03135: connection lost contact Process ID: 0 Session ID: 77 Serial number: 30453 (DBD ERROR: OCISessionEnd) during global destruction.
 
So, I got this to work kind of.  What I had to do is explicitly disconnect from the database before the database handle goes out of scope.  I'm not exactly sure why but the warning only happens when forking.  I use Parallel::ForkManager as my forking manager.
 
-  undef $self->{"sdb"}; #close connection before we fork
+  $self->sdb->disconnect; #close connection before we fork
+  delete $self->{"sdb"};  #Child starts fresh

"sdb" is a DBIx::Array object from my CPAN collection.
 
Thanks,
Mike
 
mrdvt92
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/mailman/private/houston/attachments/20130801/12efffa5/attachment.html>


More information about the Houston mailing list