-->
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.  [ 3 posts ] 
Author Message
 Post subject: 2 servlets using hibernate to preserve data
PostPosted: Sun Dec 12, 2004 6:14 pm 
Beginner
Beginner

Joined: Fri Mar 12, 2004 5:18 pm
Posts: 44
Hi,

I have 2 servlets which use hibernate to preserve data.
One is a Reader, the other is a Writer to the same database.

My question is how does the Reader knows that data in the database has been updated by the Writer and Reader needs to refresh its object built using hibernate?

Assume the Writer save the object like this:
HibernateUtil.getSession().saveOrUpdate(user);

And how does the Reader knows it needs to :
user = (User) session.load(User.class, userId);

Writer and Reader can run in different JVM.

Thank you.


Hibernate version: N/A

Mapping documents: N/A

Code between sessionFactory.openSession() and session.close(): N/A

Full stack trace of any exception that occurs: N/A

Name and version of the database you are using: N/A

The generated SQL (show_sql=true): N/A

Debug level Hibernate log excerpt: N/A


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 12, 2004 8:26 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Your into an interesting world (which means difficult and dangerous). Client distributed based caching is hard. A distributed cache will help you. Otherwise you have to implement your own update notifications that get distributed to the other JVMs to set the help data as stale (or dirty) which will then force an load the next time the object is required.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 13, 2004 12:29 pm 
Beginner
Beginner

Joined: Fri Mar 12, 2004 5:18 pm
Posts: 44
Hi,

Can someone recommend a open source solution for distributed cache? Which handle the case that I mention earlier?

Thank you.
Sam


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