I’m using Oracle DB.
And I need to call stored procedure sequentially for 1000 times. This stored procedure has several in params and out params.
Currently I’m doing it under one transaction.
Simply using java’s for-each loop and using Spring’s StoredProcedure within of it. This transaction takes about 4 seconds. And it’s not very cool. I need to speed-up this transaction time. Is there a way to do that?
Thanks in advance
Write a wrapper stored proc that calls all the other ones, inputting all the data to the wrapper proc as a hashmap, or something similar (see http://docs.oracle.com/cd/B19306_01/java.102/b14355/oraarr.htm#g1072333), storing the output in a cursor and returning it back out to Java. Call the wrapper from Java. You then let the DB do all the heavy lifting and the entire job runs in one DB tx.