You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Jean T. Anderson" <jt...@bristowhill.com> on 2007/03/02 21:50:17 UTC
batchExecute : difference in behavior between Embedded and Client
If a command in a batch fails, embedded stops processing the batch and
client continues. Myrna logged this difference as DERBY-2301 and updated
the docs [1].
I noticed two more things in moving the old testBatch test from
derbynet/callable.java to the new jdbcapi/CallableTest.java (not
committed yet), both having to do with the array of update counts
returned by the call to executeBatch() and
BatchUpdateException.getUpdateCounts().
(1) The update count for a successful call to a SQL procedure is
different between embedded (0) and client (-1).
I doublechecked ij behavior:
embedded:
ij> call batch_update_proc(2,20);
0 rows inserted/updated/deleted
client:
ij> call batch_update_proc(3,30);
Statement executed.
That might be a red herring for batches. Is this difference in the batch
update count correct?
(2) On the client, if a sql procedure in the batch fails, the update
count for that command is -1. I expected EXECUTE_FAILED: -3 [3].
Is the -1 correct? That seems like "success" to me.
thanks,
-jean
[1]
http://db.apache.org/derby/docs/dev/adminguide/cadminappsclientdiffs.html
[2]
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Statement.html#executeBatch()
[3]
http://java.sun.com/j2se/1.3/docs/api/java/sql/Statement.html#executeBatch()
Re: batchExecute : difference in behavior between Embedded and Client
Posted by "Jean T. Anderson" <jt...@bristowhill.com>.
Jean T. Anderson wrote:
> ...
> (2) On the client, if a sql procedure in the batch fails, the update
> count for that command is -1. I expected EXECUTE_FAILED: -3 [3].
>
> Is the -1 correct? That seems like "success" to me.
d'oh! pilot error. It comes through as -3.
> thanks,
>
> -jean
>
>
> [1]
> http://db.apache.org/derby/docs/dev/adminguide/cadminappsclientdiffs.html
> [2]
> http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Statement.html#executeBatch()
> [3]
> http://java.sun.com/j2se/1.3/docs/api/java/sql/Statement.html#executeBatch()