On Wed, 20 Apr 2005 13:46:13 -0700, "Tim" <[EMAIL PROTECTED]> said:
> On Wed, Apr 20, 2005 at 03:46:20PM -0400, Michael Styer wrote:
> > Is anyone able to shed some light on the situation?
> 
> The t/50cursor.t test script in the DBD::Oracle distribution uses that
> code to close the cursors that it has opened.
> 
>    http://search.cpan.org/src/TIMB/DBD-Oracle-1.16/t/50cursor.t
> 
> So it "works" at least in the sense of not failing.

OK. That's good to know. I'll copy some of the code from 50cursor.t to
test it here, but it's good to hear it works in some contexts.

> The test script doesn't then check how many cursors Oracle thinks
> are open. Patches to add that are welcome.
> 
> I'd also accept a patch to close fetched cursors automatically when the
> statement handle is destroyed ($sth2 in the example above). I'm not sure
> if it doesn't owing to a bug or an oversight.

Well, I'm not sure that it *doesn't* do this, so I wouldn't jump to
decide it's a bug. Colleagues of mine here have found that cursors do
get closed when the variables containing them goes out of scope, in a
simple example. So it looks like there's something I'm doing wrong. My
suspicion is that because I'm trying to pass the cursor reference
around, there's a reference to the cursor variable that is being held
open, meaning that it doesn't get garbage collected, and the cursor
doesn't get closed. But I don't know how to test this.

I'll see if I can find out what's going on.

Thanks for the assistance.

Mike

Reply via email to