My team is currently in the process of writing a batch job for one of our 
applications using the batch features in IBatis.  We are trying to do batch 
commits in the order of 2000 statements at a time and are getting out of cursor 
errors from Oracle.    

In our batch job we are essentially trying to execute third distinct types of 
sql statements and after looking at the SqlExecutor code it appears that 
PreparedStatements are not being reused as effectively as they could be.  In 
the current implementation of that class a PreparedStatement is only reused if 
the last sql executed was the same... otherwise another statement is created 
even if one for that sql exists in the list.  This behavior preserves the exact 
ordering of sql during execution but causes a potentially large number of 
statements to be unnecessarily created.  

In our case ordering doesn't matter since RI is enforced only at commit time 
and the preferred behavior would be to minimize the number of 
PreparedStatements created.  We have patched our local version of IBatis to do 
just that but realize that this "fix" breaks any clients that rely on batch 
execution to retain the original ordering.  Is this feature something that 
could be working into IBatis as an optional configuration... keeping the 
existing functionality as the default behavior?  Is there some other reason 
that statements are not reused in this fashion?  Thanks.

- Chris


**********************************************************************
This transmission may contain information that is privileged, confidential 
and/or exempt from disclosure under applicable law. If you are not the intended 
recipient, you are hereby notified that any disclosure, copying, distribution, 
or use of the information contained herein (including any reliance thereon) is 
STRICTLY PROHIBITED. If you received this transmission in error, please 
immediately contact the sender and destroy the material in its entirety, 
whether in electronic or hard copy format. Thank you
**********************************************************************

Reply via email to