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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate 2.1 and MySQL 4.1.3b
PostPosted: Thu Sep 02, 2004 10:34 am 
Newbie

Joined: Fri Aug 13, 2004 5:00 pm
Posts: 3
Location: Germany
Hi all,

I don't know if I should call it a hibernate bug If ound because it only appears with MySQL 4.1.3 which is not on the compatibility list. Or I made a mistake which only causes problems with MySQL 4.1.3. So please let me know if I made sth. wrong.
I post this because it could become interesting if one would also support MySQL 4.1.x
My Hibernate Version is 2.1.4
Os Win XP
And the problem:
I have between many others two classes. They're called User and 'DGKUser'
There is a one to one association between them. One youser _could_ also have a DGKUser - but this is optional. I needed to have a ' unique foreign key association' and not a 'primary key association'.
If all my Users have a DGKUser everything seems to be fine. But when there is one without a DGKUser strange things happen.
If I load a list of users (with find(..)) Only the users with a DGKUser are returned until the first one (orderd by primary keys) without that DGKUser
comes. But the returned set has the correct size.
Another phenomenon: My User has also an association to another class 'Veranstalter'. If I do load an user with DGKUser again everything is fine. If the User has no DGKUser he also has no 'Veranstalter' - but in the DB is a reference.
There is nothing which is logged.

So now the snippets for the User:

....
<many-to-one
name="dgkUser"
class="de.ecoware.etap.persistenz.model.DGKUser"
cascade="all"
outer-join="auto"
update="true"
insert="true"
access="property"
column="DGK_ID"
unique="false"
/>
(Please not that unique="true" produces the same.)

<many-to-one
name="veranstalter"
class="de.ecoware.etap.persistenz.model.Veranstalter"
cascade="all"
outer-join="auto"
update="true"
insert="true"
access="property"
column="FK_VERANSTALTER_ID"
/>



And the DGKUser:
...
<one-to-one
name="user"
class="de.ecoware.etap.persistenz.model.User"
cascade="all"
outer-join="auto"
constrained="false"
property-ref="dgkUser"
/>


So again: With MySQL 4.0.x (tested with 4.0.1 and 4.0.3 on three systems) everything is ok. But MySQL 4.1.3 on the same systems produces that strange behavior.
It would be kind if one could tell me whether I made a mistake, MySQL is the one to blame or if there is an inkompatibility between hibernate and MySQL 4.1.

Greets,

helge


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 02, 2004 10:36 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Um ... maybe ask yourself which one is a beta?


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