Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^8: Tricks with DBI

by thor (Priest)
on Dec 26, 2005 at 15:46 UTC ( #519158=note: print w/ replies, xml ) Need Help??


in reply to Re^7: Tricks with DBI
in thread Tricks with DBI

I was thinking about the OPs problem over dinner yesterday. I would imagine that the problem exists when you've got one handle open for read and you need to open another one with exactly the same statement. I wonder if prepare_cached could be changed to instead of just storing one handle, store an arrayref of them. When prepare_cached was called, it would go to the appropriate arrayref (via a hash lookup), and start iterating, calling $sth->{Active} on each until it finds one that isn't active, at which point it returns that one. If it fails to find an inactive one, it creates a new one and stores it. In the general case, you'd have only one stored. But, in cases like the OPs, it would just magically work. :)

thor

The only easy day was yesterday


Comment on Re^8: Tricks with DBI

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://519158]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (13)
As of 2015-07-06 12:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (74 votes), past polls