Or perhaps a better approach is simply:

... startBatch (boolean preserveOrder) ...



On 5/13/05, Clinton Begin <[EMAIL PROTECTED]> wrote:

Great questions (and solutions) Chris.

When I implemented the batch functionality, I found that many RDBMS drivers were problematic when prepared statements were reused (I actually think Oracle was one of them back in the 8i days).  Regardless, I think your suggestion is a good one...optional functionality. 

I suggest you create a request in JIRA with this detailed information (even just paste this email), as well as your modified SqlExecutor. 

We'll consider it for a future release (at this point I can't see why we wouldn't).  Perhaps something like:

<insert ....  preserveOrder="false"> (defaults to true)

Cheers,
Clinton



On 5/13/05, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:
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