PDA

View Full Version : Help with Opening Cursors in Spring with Oracle


sathya81
May 23rd, 2007, 12:22 PM
Hi,

I am using Hibernate with Spring on OracleXE Database. I have implemented the Spring transaction Manager. The problem i face is that whenever a record is created in to the database, I am calling a procedure which opens a cursor , and this iam calling in a loop , so for an iteration of 10, 10 cursors are getting opened and once the transaction is done, these cursors are not getting closed automatically. I observed this problem only in Oracle XE edition , where as in Oracle 10G though so many cursors are opened, they are immeidately closed.

I just wanna know is this cursor management handled by Spring? If so, y isn't this working in OracleXE?

I monitored the cursors by TOAD and querying the database for no of open cursors and it clearly indicates that for Oracle XE , these cursors aren't getting closed after the transaction, they reduce only when i stop the server.

Has any one faced this prob plz help..

wpoitras
May 23rd, 2007, 01:24 PM
As far as I know Spring doesn't do anything specific with these cursors because they are cursors. I don't think Spring knows about cursors. It treats them like ResultSets. So it closes them when its down reading them like it would with any ResultSet.

I think this an issue with OracleXE.