You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by ra...@wipro.com on 2006/06/21 13:44:59 UTC

Urgent help needed::::::::::executeBatch() method always returns 0



I am using FireBird Database.

The executeBatch() method always returns 0.  How do i know whether it is
updated any rows or not ?.
I just want to know whether the operation is success or fail.  If any
operation inside the batch is failed then
i should be able to identify it is a fail.
Otherwise If all are successful then the result should be successful.

First of all is it possible to identify success/failure using this
method.
Thanks in advance.
Please reply soon.



Thanks n Regards,
===============
Rambabu Piridi.



The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

Re: Urgent help needed::::::::::executeBatch() method always returns 0

Posted by Jeff Butler <je...@gmail.com>.
Please have a look at the new developer's guide in SVN - I updated it just
yesterday with some information about this.

There are three possibilities:

1. If you do not wrap your startBatch() ...executeBatch() statements in an
explicit transaction, then executeBatch() will return 0 and each statement
will be executed individually (not as a batch)

2. The other possibility is that the JDBC driver is returning -2 as the row
count (which is perfectly legal).  When that happens, iBATIS translates the
-2 to 0.

3. The thrid possibility is that, in reality, 0 rows were updated

In any event, an Exception will be thrown if there is a failure - so no
Exception is a pretty good sign that things worked.

Jeff Butler



On 6/21/06, rambabu.piridi@wipro.com <ra...@wipro.com> wrote:
>
>
>
>  I am using FireBird Database.
>
> The executeBatch() method always returns *0*.  How do i know whether it is
> updated any rows or not ?.
> I just want to know whether the operation is success or fail.  If any
> operation inside the batch is failed then
> i should be able to identify it is a fail.
> Otherwise If all are successful then the result should be successful.
>
> First of all is it possible to identify success/failure using this method.
> Thanks in advance.
> Please reply soon.
>
>
>
> Thanks n Regards,
> ===============
> Rambabu Piridi.
>
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you are
> not the intended recipient, you should not disseminate, distribute or copy
> this e-mail. Please notify the sender immediately and destroy all copies of
> this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses. The
> company accepts no liability for any damage caused by any virus transmitted
> by this email.
>
> www.wipro.com
>