-->
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: Help me! Error:identifier of an instance of ...?
PostPosted: Thu Apr 08, 2004 7:08 pm 
Newbie

Joined: Mon Mar 15, 2004 3:30 pm
Posts: 6
I imported data from sqlserver to mysql and I mapped it with an hibernate persistant object. when I try to get a collection of records from this table, I always get following error(it only appears in my jboss console windows):
[STDOUT] Error:identifier of an instance of com.xxx.Test1 altered from 30F423C8-E678-426E-91F7-1D76199E168D
[CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc

However, my program can still get the data without throwing an error. here is the ID type i am using:
<id
name="uniqID"
column="uniqID"
type="java.lang.String"
>
<generator class="assigned">
</generator>
</id>

the strange thing is it sometimes returns the result, but sometimes it doesn't. for example, I run my unit test for 10 time, I got about 4 times passed, but 6 times throwing an error. can someone help me?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 09, 2004 7:24 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
I suspect you are not closing your sessions properly somewhere. Please check for that.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 09, 2004 11:52 am 
Newbie

Joined: Mon Mar 15, 2004 3:30 pm
Posts: 6
I've sloved this problem by adding another auto-increment column and change it to the primary key.
it seems Hibernate doesn't support long string as the primary key. I've tried using "uuid.string" and "assigned". both were not supported by hibernate because my primary key is about 36 charecters.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 09, 2004 12:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
it seems Hibernate doesn't support long string as the primary key. I've tried using "uuid.string" and "assigned". both were not supported by hibernate because my primary key is about 36 charecters.


This is nonsense, of course.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 09, 2004 12:26 pm 
Newbie

Joined: Mon Mar 15, 2004 3:30 pm
Posts: 6
uuid is usually about 36 charecters, e.g. 30F423C8-E678-426E-91F7-1D76199E168D

I remember it was supported when I use sql server. since I changed to mysql, it doesn't support it anymore.

any idea?


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.