-->
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.  [ 5 posts ] 
Author Message
 Post subject: The id generated by TableGenerator was not use for saving
PostPosted: Thu Jul 15, 2004 1:45 pm 
Newbie

Joined: Thu Jul 15, 2004 1:35 pm
Posts: 2
Hi,

I generate a id by 'TableGenerator'

<id name="berichtId" column="bericht_id" type="integer">
<generator class="net.sf.hibernate.id.TableGenerator">
<param name="table">Primary_Key</param>
<param name="column">next_id</param>
</generator>
</id>

The table Primary_Key was updated after save a new record to the table bericht but the record have the wrong id. I try many configurations with the same result. What is wrong?

I use a Oracle 8 and hibernate 2.1

thanks for help


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 16, 2004 2:03 am 
Newbie

Joined: Thu Jul 15, 2004 1:35 pm
Posts: 2
SUPPLEMENT:

I have with all other generators the same problem. The format of the saved id's are '1,3E-76' or '4,7E-105'. Who can help me?

Joe


Top
 Profile  
 
 Post subject: Primary key inserted in Oracle database is corrupt
PostPosted: Thu Nov 11, 2004 12:30 pm 
Beginner
Beginner

Joined: Thu Nov 11, 2004 12:18 pm
Posts: 37
Location: Baltimore, MD
Quote:
The format of the saved id's are '1,3E-76' or '4,7E-105'.



I've also noticed similar behavior. It doesn't happen for every table, but it's reproducible when I find it. The problem doesn't seem to be with Hibernate, however. I've traced into the code and found that hibernate IS generating the correct PK, but somehow when it gets saved in the DB it's always some strange number. I am also using Hibernate 2.1.4 with Oracle 8.

One thing I've noticed is that my column is type Integer. Once I switched it to Number the problem went away. The weird thing is that we have many tables with Integer PK columns and this problem is sporadic. I've tried switching oracle jdbc drivers, but that didn't help. I also ran the test against a SQLServer database and the values inserted were correct. It seems like a problem with Oracle to me, possibly with our installation.

_________________
-Chris


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 12, 2004 6:47 am 
Beginner
Beginner

Joined: Mon Aug 16, 2004 6:15 am
Posts: 24
Are you by any chance inserting/updating a DATE data type in this?

If so, then I can point you at an Oracle bug (fixed by upgrading to 8.1.7.4) in which if you use a 9.2 or higher client to connect to an 8.1.7.3 or earlier database, you can get number corruptions if a date is inserted/upated also.


Solution:

Get the oracle server patched up to 8.1.7.4, or downgrade your jdbc drivers to a pre 9.2 version (depending on which is more appropriate to your installation)

(for the curious this is Oracle Bug# 2199718)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 12, 2004 1:28 pm 
Beginner
Beginner

Joined: Thu Nov 11, 2004 12:18 pm
Posts: 37
Location: Baltimore, MD
Yes it looks like it's happenening when Dates are involved. I tried to take the Date out of the inserts and it worked fine, so I think you're correct about this. We're currently using 8.1.7.0, and are going to try out the 8.1.7.4 patch.

Thanks for your help.

_________________
-Chris


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