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: Thick-client 2nd level cache - suggestions?
PostPosted: Fri Nov 03, 2006 3:25 pm 
Beginner
Beginner

Joined: Thu Nov 02, 2006 5:11 pm
Posts: 32
Location: Toronto
Hi,

I'm writing an application that will be deployed as a thick-client (NHibernate deployed on the client). The application consists of a number of loosely coupled components that access data independently which is somewhat inefficient.

Therefore I would like to use a process-wide 2nd-level cache. However, the SysCache seems targeted towards web applications, and I've read that the Prevalence cache is very slow (http://forum.hibernate.org/viewtopic.ph ... ence+cache).

Are there any cache implementations suitable for a thick-client?

Also, in the docs it says:

Quote:
Alternatively (preferrably?), you may specify <class-cache> and <collection-cache> elements in hibernate.cfg.xml


Does this mean that you can specify the cache globally, rather than on a per class/collection basis?

Thanks,
jr


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 03, 2006 4:52 pm 
Contributor
Contributor

Joined: Sat Sep 24, 2005 11:25 am
Posts: 198
You can use SysCache on winforms, it will work fine on 2.0 (1.1 should work, but not a supported scenario by MS).

Another option is to use the Caching AppBlock, which also saves to disk, which may be better as far as you are concerned.

The <class-cache> <collection-cache> are generally used to put all the cache definations in one file, instead of having them all over the place.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 03, 2006 4:53 pm 
Contributor
Contributor

Joined: Sat Sep 24, 2005 11:25 am
Posts: 198
Just a note, if you want to use the Caching AppBlock, you would need to write an adapter for NH to use it, there isn't one currently.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 03, 2006 6:00 pm 
Beginner
Beginner

Joined: Thu Nov 02, 2006 5:11 pm
Posts: 32
Location: Toronto
Thanks, I'll try SysCache then, and maybe try writing an adapter for the Caching AppBlock at some point.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 04, 2006 3:47 am 
Beginner
Beginner

Joined: Sat Sep 09, 2006 5:55 am
Posts: 23
Could anyone please tell me why the default Hashtable cache is not recommended for production use, even in smaller rich client applications?
Does it lack features (expiry, ...) or stability (memory, thread-safety, ...)?

Or is the 'not recommended' part targetted at web applications rather than (single threaded) rich clients with nhibernate deployed to the desktop?

_________________
Cheers,

Guy Mahieu


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 04, 2006 5:00 am 
Contributor
Contributor

Joined: Sat Sep 24, 2005 11:25 am
Posts: 198
Thread safety,mainly.
It is also a memory leak, because stuff never goes out unless explicitly evicted.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 04, 2006 5:19 am 
Beginner
Beginner

Joined: Sat Sep 09, 2006 5:55 am
Posts: 23
Yeah, that's what I suspected; thanks for the info Ayende.

_________________
Cheers,

Guy Mahieu


Top
 Profile  
 
 Post subject: Re: Thick-client 2nd level cache - suggestions?
PostPosted: Sun Nov 05, 2006 12:09 pm 
Contributor
Contributor

Joined: Thu May 12, 2005 8:45 am
Posts: 226
jr76 wrote:
Are there any cache implementations suitable for a thick-client?


There is a cache implementation built around memcached you might want to try. It is in the Beta1 download, or you can compile from the trunk.


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.