From: Brian C. <B.C...@po...> - 2003-07-02 10:33:21
|
While running some code which does a lot of db.select_one and db.execute calls, I was getting Oracle errors saying 'too many open cursors' - although I had only a single DBI handle open. Digging around, I found that: - I should have been using db.do() not db.execute(); the latter returns a sth which I was never using, so Oracle cursors accumulate until garbage collection kicks in - db.select_one doesn't seem to call finish() to free up the cursor. I think the attached one-line patch should fix that. However, I'm not sure if there are any knock-on effects. The default implementation of DBI::BaseStatement.finish says def finish raise NotImplementedError end Perhaps it would be safer to make this a null operation? I'm also not sure about 'select_all'. It calls 'fetch_all', but is that guaranteed to free up the cursor after it has finished? Regards, Brian. |