-->
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.  [ 3 posts ] 
Author Message
 Post subject: commit() after evict()
PostPosted: Wed Sep 21, 2005 10:44 am 
Newbie

Joined: Wed Sep 14, 2005 11:17 am
Posts: 3
Hello,

I'm charged with a fairly simple task of moving all data from one database to an identical database at a different location, deleting the data from the source. I have done this by instantiating two sessions, one for each JDBC connection. When I try to save data that has associations, I run into problems.

If I try to save the data to the new table without calling evict() on the data with associations I get HibernateException: Illegal attempt to associate a collection with two open sessions . When I evict the data in question from the original session, the save works without error. However, once I try to commit the changes on the source data session, I get:

org.hibernate.AssertionFailure: possible nonthreadsafe access to session

Does anyone know how this can be avoided?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2005 12:13 pm 
Newbie

Joined: Wed Sep 14, 2005 11:17 am
Posts: 3
Anybody? Bueller?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2005 6:28 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
Are you passing sessions between threads?? Maybe you should post your code, and the full stack trace of the exception.


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