ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: Urgent help needed::::::::::executeBatch() method always returns 0
Date Wed, 21 Jun 2006 12:49:04 GMT
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 <rambabu.piridi@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
>

Mime
View raw message