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: Multiple clients
PostPosted: Mon Sep 25, 2006 2:08 pm 
Newbie

Joined: Fri Oct 21, 2005 9:27 am
Posts: 13
Hi,

I have a special need : ideally I'd like to have one webapp and a bunch of desktops clients, all accessing one database through Hibernate : desktops apps are only there for administration of the webapp.

I know there are cache problems - all theses apps should access only one shared cache.
Correct me if I'm wrong but second level cache occured at SessionFactory level, and only one SessionFactory per app and datasource is allowed, so it shouldn't work out of the box, right ?

But can someone tell me if it could be possible to have this kind of apps design, and if it is, how ?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 25, 2006 10:16 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
The 2nd level cache is shared on a one-per-JVM basis by default, but you can configure that to be finer grained by using cache regions. Read section 19 of the ref docs.

The best and easiest way to share a single cache between multiple clients is for all the client to use a single webapp. Have user and admin logins to it. Don't have client-side applications.

It is possible to use your design, even with second level caches. You can use select-before-update, or just deal with the occasional stale object exception. And of course, you can turn off the second level cache.

_________________
Code tags are your friend. Know them and use them.


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.