Hi all,
I am executing an update on an object, first case with batch_size = 0 and the second with batch_size = 100(10);
I am getting the error (ONLY) when batch enabled:
Hibernate: update sflow_agent set address_=?, mask_=?, ip_port=?, polling_interval=?, sampling_rate=? where id=?
13:47:27,078 DEBUG BatcherImpl:234 - preparing statement
13:47:27,078 DEBUG EntityPersister:398 - Dehydrating entity: [com.db.device.SflowAgent#136]
13:47:27,078 DEBUG LongType:46 - binding '0' to parameter: 1
13:47:27,078 DEBUG ShortType:46 - binding '32' to parameter: 2
13:47:27,078 DEBUG IntegerType:46 - binding '22' to parameter: 3
13:47:27,078 DEBUG IntegerType:46 - binding '-1' to parameter: 4
13:47:27,078 DEBUG IntegerType:46 - binding '-1' to parameter: 5
13:47:27,078 DEBUG LongType:46 - binding '136' to parameter: 6
13:47:27,078 DEBUG BatcherImpl:26 - Adding to batch
13:47:27,078 DEBUG BatcherImpl:48 - Executing batch size: 1
13:47:27,078 DEBUG BatcherImpl:56 - success of batch update unknown: 0
13:47:27,093 DEBUG BatcherImpl:201 - done closing: 0 open PreparedStatements, 0 open ResultSets
13:47:27,093 DEBUG BatcherImpl:247 - closing statement
13:47:27,093 DEBUG BasicCollectionPersister:513 - Deleting collection: [com.db.device.NEMgmtInfo.connectionRates#136]
13:47:27,093 DEBUG BatcherImpl:194 - about to open: 0 open PreparedStatements, 0 open ResultSets
13:47:27,093 DEBUG BatcherImpl:228 - prepared statement get: update rate_proxy set rate_key=null, rate_index=null where rate_key=?
Hibernate: update rate_proxy set rate_key=null, rate_index=null where rate_key=?
13:47:27,093 DEBUG BatcherImpl:234 - preparing statement
13:47:27,093 DEBUG LongType:46 - binding '136' to parameter: 1
13:47:27,093 DEBUG BatcherImpl:26 - Adding to batch
13:47:27,093 DEBUG BasicCollectionPersister:529 - done deleting collection
13:47:27,093 DEBUG BatcherImpl:48 - Executing batch size: 1
13:47:27,109 DEBUG JDBCExceptionReporter:36 - SQL Exception
java.sql.BatchUpdateException: [IBM][CLI Driver][DB2/SUN] SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table. SQLSTATE=02000
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:265)
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_batch_return_code(SQLExceptionGenerator.java:845)
at COM.ibm.db2.jdbc.app.DB2PreparedStatement.executeBatch(DB2PreparedStatement.java:4903)
at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:52)
at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:118)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2365)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2318)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2258)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:57)
at com.persistence.HibernateSession.commit(HibernateSession.java:93)
at com.persistence.PersistentSession.commit(PersistentSession.java:82)
at com.db.device.DeviceHelper.updateDevice(DeviceHelper.java:417)
at com.db.device.MainDevice.go(MainDevice.java:487)
at com.db.device.MainDevice.main(MainDevice.java:48)
13:47:27,109 WARN JDBCExceptionReporter:38 - SQL Error: 100, SQLState: 02000
13:47:27,109 ERROR JDBCExceptionReporter:46 - [IBM][CLI Driver][DB2/SUN] SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table. SQLSTATE=02000
13:47:27,109 DEBUG BatcherImpl:201 - done closing: 0 open PreparedStatements, 0 open ResultSets
13:47:27,109 DEBUG BatcherImpl:247 - closing statement
13:47:27,109 DEBUG JDBCExceptionReporter:36 - SQL Exception
...................
The code :
Code:
NEMgmtInfo device = helper.getDeviceByPK(136);
List slots = new ArrayList();
NESlot slot = new NESlot();
slot.setSlotNumber(1);
slot.setShelfNumber(1);
slot.setNe_slot(device);
slots.add(slot);
List cards = new ArrayList();
NECard card = new NECard();
card.setCardType(ManufCardEnum.UNLOCKED);
cards.add(card);
card.setSlot_card(slot);
card.setNe_card(device);
slot.setCards(cards);
device.setCards(cards);
device.setSlots(slots);
helper.updateDevice(device);
What could be the difference b/w batch vs. non-batch ??
TIA,
--steve p.