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: Using "Insert ignore" in hibernate
PostPosted: Wed Jul 28, 2010 9:55 am 
Newbie

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

You can skip to the bottom to get to the crux of the matter if you like :) . . .

I have a scenario (that was described in an earlier thread) where I essentially am getting synchronization issues where the same insert can occur back to back, resulting in a ConstraintViolationException.

So from that, I've been going through different ways that this might be solved. The trivial one is to simply synchronize the method. It would be ideal to avoid this however, as this is a performance critical code section.

Next is to lock the database - this is not ideal for the same reasons however.

Finally, I've been looking into the idea of the "Insert Ignore" query. This seems to have promise for our scenario, as the only time that an insert would be called a second time is in the event of synchronization problems.



This leads to my question: Is there a way to configure hibernate to use insert ignore for its queries?


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.