-->
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.  [ 3 posts ] 
Author Message
 Post subject: IdGenerator - 'nativehilo' strategy ?
PostPosted: Fri Jan 30, 2004 6:53 am 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
Depending on your database capabilities, the native ID generation strategy will use:
- the IdentityGenerator where supported (eg. SQL Server);
- the SequenceGenerator where supported (eg. Oracle);
- otherwise the TableHiloGenerator.

We are required to support both SQL Server (development) and Oracle (production) databases - so the native strategy might be a good choice.

Unfortunately, this strategy is not very efficient since the Identity/Sequence-Generator require at least 2 SQL queries by Insert (and we have lots of inserts).

We are wondering if an additional nativehilo strategy could be defined. It would behave as follows:
- use the SeqHiloGenerator where supported (eg. Oracle);
- otherwise the TableHiloGenerator.

Does it make sense ?

(I'm actually wondering if the SeqHiloGenerator will give any additional benefit compared to the TableHilo - we could use the latest in all cases anyway).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 11:53 am 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
I've implemented such Generator.
Tell me if someone is intrested and I'll make it available to others.

Rem:
Wasn't obvious to me when reading the doc, but you can specify a custom generator class - the class attribute in the generator mapping is not restricted to those provided by default - it can be a full class name.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 2:07 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Post it into the wiki area. please.

_________________
Emmanuel


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