-->
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: increment generator thread-safe?
PostPosted: Mon Sep 21, 2009 9:22 pm 
Newbie

Joined: Mon Sep 21, 2009 9:18 pm
Posts: 1
I was wondering if the increment generator is thread-safe? From searching through the archives I was unclear whether or not it is now thread-safe. One post from 2007 mentioned there was a fix for this, but I wasn't sure if that was accurate or not. The documentation says to not use this in clusters, but it doesn't say explicitly that it isn't thread-safe.

If the increment generator is not thread-safe, is there a generator that is? I want to avoid using the native generator, because it appears that this is being called millions of times and hitting the database, and I would rather have an in-memory incrementer. Clustering is not a concern for me.

Thanks in advance for any help.


Top
 Profile  
 
 Post subject: Re: increment generator thread-safe?
PostPosted: Wed Sep 23, 2009 6:35 am 
Beginner
Beginner

Joined: Wed Jul 09, 2008 5:34 am
Posts: 41
Location: Brno, Czech Republic
Code:
public synchronized Serializable generate(SessionImplementor session, Object object)


I would say that it is :-)


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.