Re: DBI Mysql Driver Handle Mysteriously Changes!

Duncan McEwan <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <[email protected]>
Hi,

> > 
> > At the moment I only turn DBI tracing on in the connect_cached() call and
> > turn it off again before the call returns.  I did that because I was worried
> > about the amount of output that would be produced if I left tracing on.
> > But perhaps that is what I will have to do.
> 
> Perhaps you don't need to output it. Call $stacktrace = Carp::longmess
> and only output it if the stacktrace is different to the last one, or
> some similar logic.

I decided I had enough disk space to just leave debugging on for a bit and
a quick look at the debugging I'm getting now shows something that seems
odd and potentially may be interesting.

I'm now getting debugging for more than just calls to connect_cached().
It seems that as well as calling DBI->connect_cached() for it's connections to
one database, our application is also calling DBI->connect() for connections
to a different database (I think this may be buried in the CGI::Application
package that the application uses, which is why I hadn't noticed it before).

Both databases are on the same mysql server.

I haven't looked at it in detail yet (and as it's nearly home time on Friday
evening here won't have time to look at it properly until later!).  But the
quick look I have had seems to reveal that the driver handle changes after
each call (or maybe only some calls?) to DBI->connect().

Perhaps a more in-depth examination will show I've misinterpreted the debugging
and this isn't what is happening.  If so, I'll post a followup message later.
But I thought it worth posting this message now to ask if this sounds like
something that could happen.  And if it could, is it a feature or a bug?

Thanks for all the help/pointers so far...

Duncan
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.