-->
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.  [ 8 posts ] 
Author Message
 Post subject: Session cache???
PostPosted: Fri Dec 12, 2003 11:20 am 
Regular
Regular

Joined: Wed Aug 27, 2003 2:55 am
Posts: 90
Location: Sweden
Hi,

I'm trying to do the following:

OBJECT STRUCTURE

A --* B

Workflow:

1. Load 1


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 11:40 am 
Expert
Expert

Joined: Tue Sep 16, 2003 4:06 pm
Posts: 318
Location: St. Petersburg, Russia
Haven't you forgot to commit transaction?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 11:45 am 
Regular
Regular

Joined: Wed Aug 27, 2003 2:55 am
Posts: 90
Location: Sweden
Nop, it gets committed.

I can se hibernate making an insert on B object. And when I load I can se it making an select on B object.

BUT, when returned to UI it only consists of A object and no related B object.

I believe its due to the session cache, that I need to update it somehow -> tell it that A object now have a child, B object?

/Andreas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 11:51 am 
Regular
Regular

Joined: Wed Aug 27, 2003 2:55 am
Posts: 90
Location: Sweden
When I load close my app. and the loads the A object -> the related B objects comes a long.

OR

If I use session.find() instead of session.get(A, id)

Since session.find() doesn't look in session cache, I believe it have something to do with this(?)

/Andreas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 11:53 am 
Expert
Expert

Joined: Tue Sep 16, 2003 4:06 pm
Posts: 318
Location: St. Petersburg, Russia
Quote:
3. Load the object structure from DB with session.get(A, id) in a new session


If you are loading A in new session, session cache can not interfere becaue there just can not be A with given ID in cache of the new session.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 12:07 pm 
Regular
Regular

Joined: Wed Aug 27, 2003 2:55 am
Posts: 90
Location: Sweden
Pushing it up... *sorry*


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 12:10 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
B is lazy loaded (lazy collection/ proxy) ?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 12:16 pm 
Regular
Regular

Joined: Wed Aug 27, 2003 2:55 am
Posts: 90
Location: Sweden
GOT IT!!!!

My UIDGenerator who's responsible for generating UID's for my objects generates the UID with lower case.

My database (MS SQL Server, f***ing shit!) converts these UID's to upper case.

This makes the session cache to store one object A with uid lower case and one with uid upper case.

When I changed the UIDGenerator to generate uid with upper case, everythinged worked!

Damn M$ !!!! ;-)

/Andreas


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