Re: Operations on statement handles when database handle is disconnected

Tim Bunce <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
On Sun, May 15, 2011 at 02:36:51PM -0000, Greg Sabino Mullane wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
> 
> 
> > Is this a defect in DBI or in DBD::Informix (and NullP)?  
> > Or is it WAD - Working As Designed?
> 
> Not sure when this was added, but on DBD::Pg, an error is 
> given, due to this bit of code in dbdimp.c:
> 
> if (NULL == imp_dbh->conn)
>   croak("execute on disconnected handle");
> 
> Which seems like the Right Thing To Do, but I don't know 
> how standard that is.

Drivers shouldn't croak() if it can be avoided. The right thing to do is
call set_err_sv() or set_err_char() then return &PL_sv_undef (or whatever's
appropriate for an error).

Tim.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.