[CDBI] prepared statements and InactiveDestroy

Aaron Turner aturner at musecurity.com
Sat Nov 5 01:21:41 GMT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm writing a Class::DBI app which fork()'s where both parent and  
child need to keep the DBI handle.  Hence, I'm using  $dbh-> 
{InactiveDestroy} = 1; in the child so that when the child exits, the  
handle isn't thrown away.  However, after a few children, I start  
getting DBI errors like:

DBD::Pg::st execute failed: ERROR:  prepared statement "dbdpg_6" does  
not exist
[for Statement "SELECT protocol_typeid
FROM   mucore.protocol_type
WHERE  name = ?
" with ParamValues: 1='proto/http'] at /usr/lib/perl5/site_perl/5.8.5/ 
DBIx/ContextualFetch.pm line 51.

Since i know prepared statements in postgreSQL are tied to a session,  
it seems like the handle is still being destroyed and Class::DBI  
doesn't know it and is trying to re-use the prepared statement.   
Unfortunately, i'm at a loss of how to work around this issue.  Any  
ideas?

Using the latest Class::DBI, Class::DBI::Pg and DBI from CPAN as of  
today.

Thanks,
Aaron

- --
Aaron Turner, Sr. Security Engineer                    
<aturner at musecurity.com>
Ph: 408.329.6320          Fax: 408.329.6317


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFDbAkmklVhPAXg8nARAkyMAJ9IkfGXFPFUC9rdbmbmXRpP/Juv1QCfUXn/
3exgKI7FZDn9kZnr1fh2z9E=
=+twE
-----END PGP SIGNATURE-----




More information about the ClassDBI mailing list