-->
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: cache
PostPosted: Tue May 27, 2008 3:13 am 
Newbie

Joined: Fri May 23, 2008 5:20 am
Posts: 11
Location: Minusio, Switzerland
User contains a List of Message.
When a user open the page should load EVERY TIME the messages, not read from cache. I will that hibernate remake the query and exstract messages from the User.
HELP PLEASE!!!
Thanks in advance and sorry for my bad bad bad english :)

_________________
- ianaz -

http://www.ianaz.ch


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 27, 2008 10:13 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
The Hibernate cache is transactionally linked to the data in the database. How else would you get the data without going to through the Hibernate Session and using the Hibernate Session cache?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 27, 2008 10:40 am 
Newbie

Joined: Fri May 23, 2008 5:20 am
Posts: 11
Location: Minusio, Switzerland
Cameron McKenzie wrote:
The Hibernate cache is transactionally linked to the data in the database. How else would you get the data without going to through the Hibernate Session and using the Hibernate Session cache?

Thanks for your reply!!! :)

I do not see the new messages... Sometimes i see and sometimes not.

An example:

I write in a user profile:

Image

i update the page and i see the new message :) That's good.

I write another message at the same user, I update the page and voilà, the second message. That's good.
Image

I update again the page.... and I don't see the 2nd message. Occasionally, when I i press F5 I see, but sometimes not.. That's not good.
Image

What's wrong?
Sorry for my BAD BAD english :)

_________________
- ianaz -

http://www.ianaz.ch


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 27, 2008 10:56 am 
Newbie

Joined: Tue May 27, 2008 10:11 am
Posts: 7
Did you check if those two messages are saved in database?
Maybe for the second time you do not save the message.
Check your application logs. I do not think that it is cache problem.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 27, 2008 10:57 am 
Newbie

Joined: Fri May 23, 2008 5:20 am
Posts: 11
Location: Minusio, Switzerland
melu wrote:
Did you check if those two messages are saved in database?
Maybe for the second time you do not save the message.
Check your application logs. I do not think that it is cache problem.

Yep, the messages are saved in database...

_________________
- ianaz -

http://www.ianaz.ch


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 27, 2008 11:07 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
did you implement equals() and hashcode() correctly on all involved entities?

do you have transactions begin and end correctly?

l'inglese non è tanto male.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 27, 2008 11:45 am 
Newbie

Joined: Fri May 23, 2008 5:20 am
Posts: 11
Location: Minusio, Switzerland
s.grinovero wrote:
Hi,
did you implement equals() and hashcode() correctly on all involved entities?

do you have transactions begin and end correctly?

l'inglese non è tanto male.

Perfect, thanks. the problem was solved... :)

_________________
- ianaz -

http://www.ianaz.ch


Top
 Profile  
 
 Post subject: flush
PostPosted: Tue May 27, 2008 12:12 pm 
Newbie

Joined: Tue Apr 22, 2008 5:26 am
Posts: 6
Location: Milan
I know that isn't a best practice but sometimes, usually when you are using dataTable for view and list of data, you may also need an EntityManager flushing.


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.