-->
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.  [ 2 posts ] 
Author Message
 Post subject: saveOrUpdateAll, throw out exception
PostPosted: Mon Apr 10, 2006 1:27 am 
Newbie

Joined: Fri Nov 18, 2005 1:06 pm
Posts: 15
I just think this is interesting, after running a period of time, some time my Progam will throw out following exception, in my code there is nothing special, following is my code:

public void saveData(List data)
{
if(data==null || data.isEmpty())
return;

try
{
getHibernateTemplate().saveOrUpdateAll(data);
}catch (Throwable t)
{
t.printStackTrace();
}
}

but it will throw out following exception:

2006-04-09 22:13:10,156 [org.hibernate.event.def.AbstractFlushingEventListener] - Could not synchronize database state with session
[INFO] org.hibernate.exception.ConstraintViolationException: could not insert: [com.stonewatercontrols.model.data.Datapoint5minutesdata]
[INFO]
.................
org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdateAll(HibernateTemplate.java:690)
[INFO] at com.stonewatercontrols.dao.hibernate.DataDaoHibernate.saveData(DataDaoHibernate.java:52)
......


this issue is from pk duplicatie or constrain violation, but this is not the case for my program, since I log out the value for the pk or unique constrain , they are OK,

and it seems that this issue is also from buffered insert, I am not sure if this is a bug of hibernate or spring.

this issue is not repeatable , so I don't think this is from my code(see above), my code is very simple, no any specail thing there.

any advise will be appreciated.

Thanks
Jack


Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject: 2 c
PostPosted: Mon Apr 10, 2006 3:54 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Pure guesswork, but you might want to make sure that JVM uses -server flag.

http://opensource.atlassian.com/project ... e/HHH-1579

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.