-->
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.  [ 1 post ] 
Author Message
 Post subject: org.hibernate.exception.GenericJDBCException:could not updat
PostPosted: Mon Apr 26, 2010 1:13 pm 
Newbie

Joined: Mon Apr 26, 2010 9:28 am
Posts: 1
Hi All,
I have a batch process which updates two tables in a for loop as shown in the below code snippet.The size of the marsInvoiceDAOList is 30,079 and all records are updated except two giving the error mentioned in the subject line.
I am trying to update thousands of duplicate records to the two tables.
If I dont put the code in REd color then I used to get the org.hibernate.NonUniqueObjectxception.A different object with the same identifier value was already associated with the session.
...
BhrvInvoiceDAO bhrvInv = new BhrvInvoiceDAO();
int indx=0;
for(MarsInvoiceDAO mars : marsInvoiceDAOList)
{
this.getSession.update(mars);
bhrvInv = getBhrvInvoiceDAO(mars.getBhrvInvoiceId);
bhrvInv.setProcessStatusCode(5);
this.getSession.update(bhrv);
indx++;
if(indx % 20 == 0)
{
this.getSession.flush();
this.getSession.clear();
}

}

I have mentioned the batch_size as 20 and second level cache as false in the hibernate config file.

I am unable to understand why only two records out of 30,079 fail and why?

Any help is higly appreciated.


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

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.