-->
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.  [ 12 posts ] 
Author Message
 Post subject: 2.1 beta 3b property-ref / caching problem
PostPosted: Mon Sep 08, 2003 8:47 am 
Newbie

Joined: Mon Sep 08, 2003 7:30 am
Posts: 17
Gavin,

possibly, there is a bug regarding the property-ref attribute of one-to-one associations and the caching of entities ...

Consider two entities A and B with each having it's own id.

As far, as I understood, starting from 2.1 we can define a proptery, which is not the id, to make the association.

So, entity B contains a property (let's sax id_of_a), which contains the id of A, I used the property-ref to define this.

Everything works fine until you switch on caching ...

The first access works well, but the second one does not, because Hibernate tries to look up the B entitiy for a paticular A entity with the id of the B entity, not the value of the id_of_a property.

Do you understand?

I guess, that the cache look-up stuff is not aware of the property-ref settings ...

Here is the corresponding query: select distinct a from ABean a, a.bee b

Thanx


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 08, 2003 9:54 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Naaaah! Not Possible!


heh :)


I'll have a look. This seems very likely.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 08, 2003 1:01 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
This is fixed in CVS


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 09, 2003 1:32 am 
Newbie

Joined: Mon Sep 08, 2003 7:30 am
Posts: 17
Great! Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 09, 2003 4:00 am 
Newbie

Joined: Mon Sep 08, 2003 7:30 am
Posts: 17
Gavin,

I wanted to checkout the changes from CVS, but there seems to a problem with the sourceforge CVS server. I'll try it later again.

The nightly snapshots seem to be from the 2.0.x branch, right? Would be nice, if we had a snapshot from head too ...

-Markus


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 09, 2003 4:14 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Its in v21branch, which is not snapshotted :(


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 09, 2003 10:19 am 
Newbie

Joined: Mon Sep 08, 2003 7:30 am
Posts: 17
Gavin, do you have access to the sourceforge CVS server?

I tried it this afternoon, without success. Is it down?

-Markus


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 13, 2003 6:01 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
The nightly snapshots are now the v21branch.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 14, 2003 1:03 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
ace!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 16, 2003 3:45 am 
Newbie

Joined: Mon Sep 08, 2003 7:30 am
Posts: 17
Gavin,

ace!

The property-ref works now ...

I'm afraid, but I believe, that there is another issue concering this topic:

the associated entities seem not to be cached, if I use the property-ref for one-to-one associations.

If have 2 entities, both with caching enabled, with a one-to-one association using the property-ref attribute. The associated entity gets queried again and again ...

I suppose, that this has to do with the lookup of the entity in the cache, where the PK is used instead of the property in property-ref ...?

-Markus


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 16, 2003 2:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Correct. Only lookups by PK are cached.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 17, 2003 3:30 am 
Newbie

Joined: Mon Sep 08, 2003 7:30 am
Posts: 17
Will this be changed in the future?


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