-->
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.  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: JBoss clustering and Hibernate cache
PostPosted: Fri Nov 19, 2004 11:09 pm 
Regular
Regular

Joined: Tue Nov 09, 2004 5:15 pm
Posts: 100
Hibernate version:
2.1.6

We are planning to use Hibernate/JBoss in our new project. If we want to use JBoss clustering feature for fail-safe, how does JBoss handle the Hibernate cache??? Does it try to synchronize the HibernateCache on all the clusters? If yes, won't it be a performance hit?

I'm quite new to JBoss/Hibernate and any input on this is greatly appreciated.

I just came across HAR and i'm yet to read about that. I'm planning to do it this weekend.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 20, 2004 12:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Use the JBossTree cache as the second level cache. Read JBoss web site for further (detailed) information.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 20, 2004 12:57 am 
Regular
Regular

Joined: Tue Nov 09, 2004 5:15 pm
Posts: 100
Thanks David. I'll read the documentation for TreeCache.

If i want to use JBoss/Spring/Hibernate so that spring can manage Hibernate sessions/transactions, can i still use TreeCache?

Thanks again!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 20, 2004 11:47 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I don't use Spring in my work but many do and there should be no reason for it not to work. This is one of those - try and see - situations.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 21, 2004 2:40 pm 
Regular
Regular

Joined: Tue Nov 09, 2004 5:15 pm
Posts: 100
Thanks David. I just read the documentation for JBoss TreeCache and TreeCacheAOP. I think TreeCacheAOP makes more sense to me as i want the Cache to handle the inheritence hierarchy of my POJOs.

Now i understand that in the hibernate mapping files, to plug the TreeCacheAOP, i need to configure the cache_provider as TreeCacheAOP and set the related attributes and do putObject to add the class to be managed.

One question i've is (may be it's too weird), why Hibernate cache is called second-level cache (it's a cache on top of the datastore and that's the purpose of any cache)? what's different here and why the name SECOND?


Also, do i need to do this for all classes (POJOs)?

Where should i write the code putObject??? Say for example i've class A which is a POJO. For this, i'll have a DAO as ADao. I'll provide a Facade interface say MyProjImpl so that the client can call my business interface. Here, where should i write the code putObject to add my POJO to the cache?

Could you please let me know or point to any references?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 21, 2004 5:05 pm 
Regular
Regular

Joined: Tue Nov 09, 2004 5:15 pm
Posts: 100
If an external application directly modified the datastore, the hibernate cache becomes invalid. In this case, how will hibernate detect this change to the datastore? how should i handle this case? Any event notifications?

Could some one provide some insight on this?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 21, 2004 5:08 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
There is not much free documentation from us about these things at the moment (a very generic, not necessarily Hibernate-only topic). Hibernate in Action has a chapter about transactions and caching.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 21, 2004 5:36 pm 
Regular
Regular

Joined: Tue Nov 09, 2004 5:15 pm
Posts: 100
One other thing is, if we try to replicate the Hibernate cache (even using JBossTreeCacheAOP) won't there be performance overhead?

Could some one provide some input on using TreeCacheAOP on clustered environment?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 21, 2004 5:40 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
I'm not sure JBoss Cache AOP is in a final stage, the right place to ask is the JBoss-* forum we have here or at www.jboss.org, where Bela and Ben will read it. We will merge forums sooner or later. :)

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 21, 2004 6:15 pm 
Regular
Regular

Joined: Tue Nov 09, 2004 5:15 pm
Posts: 100
Thanks Christian.

How about SwarmCache? You refered it in Hibernate in Action book. I've not read about SWarmCache yet. (I've too many things to read :) ) Is it a potential alternative for TreeCacheAOP? Is it the so-called "Object-oriented" cache which can manage inheritence hierarchy of POJOs?

Any other alternatives? I'll also check in the JBoss forum.

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 21, 2004 6:16 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Normal JBoss Cache (without AOP replication).

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 21, 2004 6:53 pm 
Regular
Regular

Joined: Tue Nov 09, 2004 5:15 pm
Posts: 100
But normal JBoss TreeCache doesn't support object-oriented caching for POJOs?? do i need to explicitly handle that?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 21, 2004 6:58 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
I don't understand the term "object-oriented" in this context... the JBoss Cache AOP variation can replicate fine-grained changes instead of bigger update packages, for speed improvements in (I think) many situations. Your best bet for now may be the documentation of both and a quick look at the tutorials, all on www.jboss.org.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 30, 2004 8:08 pm 
Regular
Regular

Joined: Tue Nov 09, 2004 5:15 pm
Posts: 100
Sorry for the late reply.

Here's the excerpts from JBoss TreeCacheAOP documentation page

Quote:
The JBossCache component, TreeCacheAop, is a replicated and transactional "object-oriented" cache. By "object-oriented", we mean that TreeCacheAop provides tight integration with the object-oriented Java language paradigm, specifically it automatically : 1) manages object mapping and relationship, 2) provides support for inheritance relationship between "advised" POJOs (plain old Java object), and 3) preserves object identity, for a client under both local and replicated cache modes.


Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 07, 2005 7:10 pm 
Beginner
Beginner

Joined: Sun May 09, 2004 7:18 pm
Posts: 35
ssa1 wrote:
If an external application directly modified the datastore, the hibernate cache becomes invalid. In this case, how will hibernate detect this change to the datastore? how should i handle this case? Any event notifications?

Could some one provide some insight on this?

Thanks!


I am especially interested in this question. I read the Hibernate in Action, I didn't find answer to this question.

So, what if the database is chanaged outside Hibernate, the second level cache becomes invalid. Is there a way I can clean up the memory cache without restarting the whole application? I tried new Configuration().configure(file).buildSessionFactory(), but it doens't work.

Any idea about this question? I think this is a very common situation. Whenever people run into problem of caching, they should be able to clear the memory caching without restarint application.

Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 20 posts ]  Go to page 1, 2  Next

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.