-->
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: Concurrency issue with findOrCreate
PostPosted: Tue Jul 27, 2010 2:22 pm 
Newbie

Joined: Tue Jul 27, 2010 2:13 pm
Posts: 2
Hello all,

I've been working with a testing environment where the entire schema is created upon startup, and then we benchmark how long it takes to persist a few instances of our data model in parallel. The issue is that there's some more generalized "static" data that is used in all of the data model instances. When persisting in parallel, we don't have instances of the static data in the database, and therefore it needs to be persisted as well. When running it in parallel though, it frequently tries to insert the static data multiple times.

It then throws
Code:
org.hibernate.exception.ConstraintViolationException: could not Insert . . .


I can solve this problem with synchronization of course, but I first wanted to check if there's anything in Hibernate that would solve this issue (and maybe faster than basic synchronization). I've been told this issue affects some scenarios outside of this testbed as well.

Thanks in advance!
Rob


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.