-->
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: ID Considerations
PostPosted: Wed Nov 01, 2006 10:24 am 
Newbie

Joined: Fri Oct 27, 2006 8:43 am
Posts: 14
Hello guyz,

I'm working on the development of a huge project, and all my entity classes will use the same ID generator. All entity classes extends a MappedSuperclass, where the id is declared.

I'm opening here a discussion on advantages and disadvantages of uuid, sequence and sequencehilo generators.

We're using Oracle.


Currently all our entities implement a superclass, and this superclass is defines an uuid of size 32. There is no id repetition per table, each id generated for all entities is different.

We are considering changing it to sequence generator, and i have some doubts:

- If i declare a sequence generator in a superclass that will be used by ALL entities (and there's a lot) will the sequence be unique for all entities or each subclass will have its own sequence? Or will i need to declare one sequence id per each entity?

- SequenceHiLo generator has a better performance than sequence generator. Is there a known drawback? An idea of the number of rows to make this performance gain noticeable?

Well, thanks a lot for any help,

Chico Science


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 01, 2006 5:46 pm 
Beginner
Beginner

Joined: Mon Dec 06, 2004 4:20 pm
Posts: 34
Hey Chico,

We have a relatively large database (8 million rows in one table), and we are using an oracle sequence for each table. The HiLo thing may be a bit quicker, but we have seen no performance problems using this strategy. We have a 5 second SLR response time for a web app, and inserts/updates work just fine.

Why would you want to use one sequence for all of your inserts? Are you attaching a special meaning to this surrogate key? Or have I missed your point?

Don


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 03, 2006 7:02 am 
Newbie

Joined: Fri Oct 27, 2006 8:43 am
Posts: 14
Dononelson,

actually we don`t want to use a single sequence for all tables. My doubt is that if all my entities extend a superclass, and the sequence id is declared in this superclass, would then the sequence be unique per entity or would it be common for all entities??

Thank you a lot,

Chico Science


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 05, 2006 1:21 pm 
Beginner
Beginner

Joined: Mon Dec 06, 2004 4:20 pm
Posts: 34
The sequence would be common for all entities, unless you define the ID mapping differently for each sub-class. I don't know how you are maintaining your mapping files, but I use xdoclet, which would make it impossible to define the ID mapping for each sub-class, since there would be no ID field to map to.


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.