db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean T. Anderson" <...@bristowhill.com>
Subject batchExecute : difference in behavior between Embedded and Client
Date Fri, 02 Mar 2007 20:50:17 GMT
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()

Mime
View raw message