Hi all,
I am dealing with an out of memory exception while calling an Oracle stored procedure using Callable statement.
I have called 20000 objects with this procedure, procedure doesnt complain. Then when the objects are 24000 I got the error.
So what I did is, I created sublists with 1000 objects each and then for those 1000 objects, I call the stored procedure.
Still I deal with the same problem..
Any ideas will be appreciated.
Right now when I generate sublists, I am creating connection objects and then closing them also for each 1000 sets.
so its like one connection object will work for 1000 objects.
Callable statement is also registered once for every 1000 objects
csValues = conn.prepareCall("{ ? = call getvalues_proc(?,?,?,?,?,?,?) }");
csValues .registerOutParameter(1, oracle.jdbc.OracleTypes.CURSOR);
then before i stop working on these 1000 objects, I dispose the connection object and the csValues callablestatement also.
But still it fails saying Out of memory exception.
This is what it says exactly
Exception in thread "main" java.lang.OutOfMemoryError
at oracle.jdbc.driver.OracleStatement.prepareAccessors(OracleStatement.java:879)
at oracle.jdbc.driver.T4CResultSetAccessor.getCursor(T4CResultSetAccessor.java:315)
at oracle.jdbc.driver.OracleCallableStatement.getCursor(OracleCallableStatement.java:1659)
Please provide any thoughts
Now here is how I generate sublists.. I am thinking that I keep on creating list objects.. so even though Its working on 1000 objects at a time, the previously creating objects are still existing in memory.
Am I correct ?
this is a sample method I have which I use to create sublist
Thanks
Atul
[NK: Added code tags]
I am dealing with an out of memory exception while calling an Oracle stored procedure using Callable statement.
I have called 20000 objects with this procedure, procedure doesnt complain. Then when the objects are 24000 I got the error.
So what I did is, I created sublists with 1000 objects each and then for those 1000 objects, I call the stored procedure.
Still I deal with the same problem..
Any ideas will be appreciated.
Right now when I generate sublists, I am creating connection objects and then closing them also for each 1000 sets.
so its like one connection object will work for 1000 objects.
Callable statement is also registered once for every 1000 objects
csValues = conn.prepareCall("{ ? = call getvalues_proc(?,?,?,?,?,?,?) }");
csValues .registerOutParameter(1, oracle.jdbc.OracleTypes.CURSOR);
then before i stop working on these 1000 objects, I dispose the connection object and the csValues callablestatement also.
But still it fails saying Out of memory exception.
This is what it says exactly
Exception in thread "main" java.lang.OutOfMemoryError
at oracle.jdbc.driver.OracleStatement.prepareAccessors(OracleStatement.java:879)
at oracle.jdbc.driver.T4CResultSetAccessor.getCursor(T4CResultSetAccessor.java:315)
at oracle.jdbc.driver.OracleCallableStatement.getCursor(OracleCallableStatement.java:1659)
Please provide any thoughts
Now here is how I generate sublists.. I am thinking that I keep on creating list objects.. so even though Its working on 1000 objects at a time, the previously creating objects are still existing in memory.
Am I correct ?
this is a sample method I have which I use to create sublist
Thanks
Atul
[NK: Added code tags]