| Author |
ora-0100 maximum number of cursors exceeds
|
vikram bollu
Greenhorn
Joined: Sep 07, 2009
Posts: 9
|
|
I am trying to insert more than 1 lac records, and it is inserting successfully. but the below exception is displaying...
ora-0100 maximum number of cursors exceeds
wht might be the reason for this and how to solve this.
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
You are opening more connections than Oracle is configured to allow. Do you always close connections when you are finished with them?
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
vikram bollu
Greenhorn
Joined: Sep 07, 2009
Posts: 9
|
|
Actually i am using one connection, and im adding all statements to batch ( statement.addBatch(); ).
For every 1000 statements im executing batach. If something happens wrong thn it should rollback everything.
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
Can we see your code?
|
 |
vikram bollu
Greenhorn
Joined: Sep 07, 2009
Posts: 9
|
|
|
|
 |
Balu Sadhasivam
Ranch Hand
Joined: Jan 01, 2009
Posts: 874
|
|
close all your preparedStatement at the end of loop.
|
 |
vikram bollu
Greenhorn
Joined: Sep 07, 2009
Posts: 9
|
|
Balu Sadhasivam wrote:
close all your preparedStatement at the end of loop.
Thanks for you reply,
Actually i had closed the connection in the finally block , is it required to closed the preparedstatement saparately??
|
 |
Balu Sadhasivam
Ranch Hand
Joined: Jan 01, 2009
Posts: 874
|
|
Actually i had closed the connection in the finally block , is it required to closed the preparedstatement saparately??
Since you create statements inside loops , close at end of loop.. in all cases , check for null and close in finally block.
|
 |
vikram bollu
Greenhorn
Joined: Sep 07, 2009
Posts: 9
|
|
thanks for your reply,
i will check for null and close it in the finally block.
|
 |
 |
|
|
subject: ora-0100 maximum number of cursors exceeds
|
|
|