reconnect, but no insert
- From: "Daisy" <jeffrdrew@xxxxxxxxx>
- Date: 16 Mar 2007 11:39:06 -0700
Can anyone point me to some diagnostics I could do on the following
problem?
After an error occurred on insert, my program reconnected to the
database and indicated it was successfully inserting. However, no
inserts appeared in the table. I do not have concurrent writes to
tables. I open one connection for each of the 7 tables that I write
to. I noticed a post from the 12th that had a similar no-insert
problem but it was related to connection pools.
ERROR
java.sql.BatchUpdateException: ORA-01401: inserted value too large for
column
at
oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:
343)
at
oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:
10698)
the application closed the existing connection and reconnected.
Application status messages indicated that inserts were working.
Examination of the table revealed that the data was inserted until the
time of the error, but no data after the error.
APPLICATION
My application is a plain old Java application that opens the
connection to Oracle using a thin driver. This code has worked for a
long time with mysql, including the reconnect code. I recently changed
to Oracle by using the following two methods:
DriverManager.registerDriver( new OracleDriver( ) );
java.sql.Connection connection=
DriverManager.getConnection( jdbc:oracle:thin:@10.152.109.21:1540:NYTRMD,
user , password );
INSERT CODE
PreparedStatement
preparedStatement=connection.prepareStatement( "insert into
orders(orderId,serial) values(?,? );
# the following is actually called repeatedly until the batch size is
100
preparedStatement.setString(1, order.orderID);
preparedStatement.setLong( 4, order.serialNo );
preparedStatement.addBatch();
# when the batch size is 100, the following is executed
updateCounts = preparedStatement.executeBatch();
connection.commit();
I'm using the ojdbc14.jar drivers. It's an Oracle 9 database.
Does anyone know why the reconnect failed to produce inserts? Is there
another error condition I should test?
Thanks
.
- Prev by Date: Re: HSQLDB Lock files
- Next by Date: Re: Two of three SQL stmts execute: third results in table does not exist exception
- Previous by thread: plz help, how to get the correct ID from DB ?
- Next by thread: [Hibernate] Weak entities
- Index(es):
Relevant Pages
|
|