-->
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: Why is IdentifierGenerator required for StatelessSession
PostPosted: Mon Jul 08, 2013 9:50 am 
Newbie

Joined: Mon Jul 08, 2013 9:36 am
Posts: 1
I understand that an IdentifierGenerator is necessary for normal Hibernate usage. It makes sense that Hibernate would need to know the ID to maintain the persistence context. However, why is a generator necessary for a stateless session?

My problem is that I'd like to use the Identity generation strategy in most places. I use MySQL and that is the simplest and most natural strategy. I have one section where I need to do a large number of inserts. The only way currently to get optimal performance is to change the generation strategy.

If I'm using a StatelessSession, why would Hibernate require the ID of the entity? Why can't it just insert the entity and not retrieve the ID? Is there a flag I can use or some special way to create a session or transaction to say that I don't care about identifier tracking for this operation?


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.