ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From navrsale <navrsalem...@yahoo.ca>
Subject Re: BatchException
Date Tue, 16 Jan 2007 01:46:17 GMT

No problem, it just seems non-intuitive.
While driver has to throw batch update exception as it cannot know if that
should be a bailout error or not (and there are different versions of
drivers), iBatis could decide differently, i.e. if there are some failed
statements in a batch to just return int[] row counts to the caller without
throwing exception (if no nested batches). Only if there are nested batches
it should throw BatchException (otherwise getSuccessfulBatchResults() will
always return empty list and aslo getFailingSqlStatement() would be of no
use as there is only one statement anyways. getFailingStatementId() would
also be of no use as it can be inferred from returned int[].

Jeff Butler-2 wrote:
> If there is only one batch, then that is one "sub batch" according to the
> way iBATIS works.
> BatchException is thrown anytime the driver throws BatchUpdateException -
> which can happen even on the first sub batch.  BatchException is used to
> give you as much information as is possible from the driver.
> I think the documentation and the code are correct.  Are you experiencing
> a
> problem?
> Jeff Butler
> On 1/12/07, navrsale <navrsalemile@yahoo.ca> wrote:
>> I just checked and it seems to be a bug in iBATIS 2.2 (maybe 2.3 as
>> well).
>> BatchException is supposed to be thrown only when there are nested
>> batches,
>> according to documentation. It is thrown when executeBatchDetailed() is
>> used.
>> But when there is only one batch (with no nested batches) then this
>> exception should not be thrown?
>> Can somebody confirm this please?
>> navrsale wrote:
>> >
>> > is BatchException only nested batch related, i.e. if there is only one
>> > batch and no nested batches and executeBatchDetailed() is used, then
>> this
>> > exception will never be thrown?
>> >
>> > Many thanks,
>> >
>> --
>> View this message in context:
>> http://www.nabble.com/BatchException-tf2962931.html#a8309881
>> Sent from the iBATIS - User - Java mailing list archive at
>> Nabble.com<http://nabble.com/>
>> .

View this message in context: http://www.nabble.com/BatchException-tf2962931.html#a8383016
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

View raw message