-->
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: Integer Overflow
PostPosted: Mon Nov 18, 2013 7:14 pm 
Newbie

Joined: Mon Nov 18, 2013 7:00 pm
Posts: 1
Hi All,

Version: Hibernate 4.2.3

I have an entity that has an Integer object for its Id. I have a sequence generator that is assigning a value to the Id when saving the object to the database (Oracle 11g). The sequence has passed 2^31-1 which is the max value for an Integer in Java. I would expect an exception when assigning this value to my Id, but instead it seems to be saving the lower order 32 bits. Is there a way to catch this rather than having the integer overflow and continuing to persist the object? I did not expect a silent overflow to occur like this.

Thanks,
Devin


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.