-->
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: Ensuring unique ids with TableHiLoGenerator
PostPosted: Thu Jul 05, 2007 4:53 am 
Newbie

Joined: Thu Jul 05, 2007 4:03 am
Posts: 1
Hi.

I am creating a database application using Hibernate and Derby. A number of the tables use the following to generate the id:
Code:
    <id name="id" type="int" column="id" unsaved-value="-1">
      <generator class="native"/>
    </id>


This causes the TableHiLoGenerator to be used to create the ids.

I was wondering how this class ensures that unique ids are generated in the case where a large number of records are inserted and deleted, so that the value in HIBERNATE_UNIQUE_KEY wraps around?

Looking at the code, I can't see any safeguard to prevent this.

Thanks,

Carl


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.