Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DBD-Oracle CPAN distribution.

Report information
The Basics
Id: 72716
Status: resolved
Priority: 0/
Queue: DBD-Oracle

People
Owner: Nobody in particular
Requestors: david [...] schweikert.ch
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Setting ora_connect_with_default_signals causes connect_cached to misbehave
Download (untitled) / with headers
text/plain 382b
Using the ora_connect_with_default_signals feature has as consequence a dbi handle leakage on every connect_cached call. The reason is that connect_cached makes a string key out of the connect arguments for caching purposes and that key changes every time, if a arrayref is used. That's pretty bad, because you pretty soon run out of available connections on the Oracle server side.
Subject: Re: [rt.cpan.org #72716] Setting ora_connect_with_default_signals causes connect_cached to misbehave
Date: Fri, 25 Nov 2011 09:58:46 +0000
To: "david [...] schweikert.ch via RT" <bug-DBD-Oracle [...] rt.cpan.org>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
Download (untitled) / with headers
text/plain 929b
Show quoted text
> Using the ora_connect_with_default_signals feature has as consequence a > dbi handle leakage on every connect_cached call. The reason is that > connect_cached makes a string key out of the connect arguments for > caching purposes and that key changes every time, if a arrayref is used. > That's pretty bad, because you pretty soon run out of available > connections on the Oracle server side.
That could be addressed by a doc patch suggesting that instead of ora_connect_with_default_signals => [ ... ] code using connect_cached should ensure that a reference to the same array is used each time: my @ora_default_signals = (...); ... ora_connect_with_default_signals => \@ora_default_signals You could probably also play with our (or state in recent perls) to get the same effect on one line: ora_connect_with_default_signals => (our $foo ||= [ ... ]) but that's harder to explain in the docs. Tim.
From: david [...] schweikert.ch
Download (untitled) / with headers
text/plain 442b
On Fri Nov 25 04:59:03 2011, Tim.Bunce@pobox.com wrote: Show quoted text
> That could be addressed by a doc patch suggesting that instead of > > ora_connect_with_default_signals => [ ... ] > > code using connect_cached should ensure that a reference to the same > array is used each time: > > my @ora_default_signals = (...); > ... > ora_connect_with_default_signals => \@ora_default_signals
I agree. That's the way I solved it in my code.
Download (untitled) / with headers
text/plain 674b
On Fri Nov 25 05:08:24 2011, david@schweikert.ch wrote: Show quoted text
> On Fri Nov 25 04:59:03 2011, Tim.Bunce@pobox.com wrote:
> > That could be addressed by a doc patch suggesting that instead of > > > > ora_connect_with_default_signals => [ ... ] > > > > code using connect_cached should ensure that a reference to the same > > array is used each time: > > > > my @ora_default_signals = (...); > > ... > > ora_connect_with_default_signals => \@ora_default_signals
> > I agree. That's the way I solved it in my code.
Documentation changed in subversion trunk to mention this possible problem and the solutions Tim presented. Martin -- Martin J. Evans Wetherby, UK
v1.38 released.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.