-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Batch problem ??
PostPosted: Tue Nov 18, 2003 2:58 pm 
Pro
Pro

Joined: Mon Sep 08, 2003 4:30 pm
Posts: 203
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 18, 2003 9:49 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
What DB2 version. I used to have problems with JDBC batch updates on DB2 v7, but they seem to be gone in 8.1.

P.S. Any problems that occur when you flip JDBC batch updates on are almost always the result of a driver bug.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 18, 2003 10:09 pm 
Pro
Pro

Joined: Mon Sep 08, 2003 4:30 pm
Posts: 203
gavin wrote:
What DB2 version. I used to have problems with JDBC batch updates on DB2 v7, but they seem to be gone in 8.1.

P.S. Any problems that occur when you flip JDBC batch updates on are almost always the result of a driver bug.



Db2 7.2 Service Pack 7.
thx, Gavin.

P.S. For some cases even the update works, but is stumbles for complex relationships.

--steve p.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 18, 2003 10:14 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Yeah, I think the situation is that batch updates "sort of" work in 7 ... until you really try to use them ... and then they fall over...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.