-->
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.  [ 4 posts ] 
Author Message
 Post subject: Identity generator pooling and batching issue
PostPosted: Thu Apr 26, 2007 11:44 pm 
Newbie

Joined: Thu Apr 26, 2007 11:36 pm
Posts: 4
Location: Brisbane, Australia
We have an identity generator using the new generator in hibernate 3.2.3. Our configuration looks like:

<generator class="org.hibernate.id.enhanced.SequenceStyleGenerator">
<param name="sequence_name">ev_sequence</param>
<param name="optimizer">pooled</param>
<param name="increment_size">20</param>
</generator>

We have a batch size set to a number larger than 1.

But our hibernate trace shows things like:

2007-04-27 13:24:44,949 DEBUG org.hibernate.jdbc.AbstractBatcher - Executing batch size: 1

The hibernate documentation says in Ch 13: "Note that Hibernate disables insert batching at the JDBC level transparently if you use an identiy identifier generator."

So what's the point of using pooling if we can't batch? Any help on this would be appreciated. We're about to do our own pooling hack to work around this if we can't find a fix.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 27, 2007 12:41 am 
Newbie

Joined: Thu Apr 26, 2007 11:36 pm
Posts: 4
Location: Brisbane, Australia
We've just discovered that it isn't the identity generator that's causing our problem.

It's the fact that we have multiple inserts with a common identity (i.e. the tables are joined).

We still haven't figured out why batching isn't working though...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 27, 2007 2:31 am 
Newbie

Joined: Thu Apr 26, 2007 11:36 pm
Posts: 4
Location: Brisbane, Australia
We're going through the hibernate code and in "AbstractEntityPersister" there is a statement:

"we can't batch joined inserts, *especially* not if it is an identity insert; nor can we batch statements where the expectation is based on an output param".

The question is - why not?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 29, 2007 11:40 pm 
Newbie

Joined: Thu Apr 26, 2007 11:36 pm
Posts: 4
Location: Brisbane, Australia
This is an existing hibernate issue.

See: http://opensource.atlassian.com/project ... owse/HHH-1


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