lesteryu / log4jdbc

Automatically exported from code.google.com/p/log4jdbc
0 stars 0 forks source link

executeBatch in StatementSpy doesnt clean batched statements #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create PreparedStatement
2. add batch
3. execute
4. add another batch
5. execute

What is the expected output? What do you see instead?
I expected to see execute 3 and execute 4 seperatly but I get 3+4 in execute 4

Original issue reported on code.google.com by Daniel.D...@gmail.com on 8 Dec 2008 at 7:51

GoogleCodeExporter commented 9 years ago
This feature has been added to log4jdbc 1.2 alpha 2 - would appreciate a 
message back 
from you after testing/using this feature.

Original comment by arthur.b...@gmail.com on 27 Feb 2009 at 3:43

GoogleCodeExporter commented 9 years ago
I find the JDBC Javadoc inaccurate, but if Informix is right, the batch must 
also be
cleared if realStatement.executeBatch() throws an exception. 

Informix 3.50.JC3 does clear the batch. From my test program's log (using a
PreparedStatement with two parameters):
  DEBUG|util.DbBatchStatement|batch params before executeBatch: [5, g, 6, h]
  INFO |jdbc.sqlonly|batching 21 statements:
I.e. the real PrepStmt had params for two commands, and log4jdbc still thought 
there
were 21. (DbBatchStatement is a utility that continuously re-adds the commands 
that
the underlying PrepStmt left out after an exception, until all commands have 
been
executed.)

Original comment by t....@gmx.de on 19 Aug 2009 at 2:30

Attachments:

GoogleCodeExporter commented 9 years ago
Issue 22 has been merged into this issue.

Original comment by arthur.b...@gmail.com on 26 Jun 2010 at 5:08