-->
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.  [ 11 posts ] 
Author Message
 Post subject: Hibernate 2.1 b6 & EHCache
PostPosted: Thu Nov 20, 2003 4:24 am 
Newbie

Joined: Wed Oct 08, 2003 8:52 am
Posts: 10
Hi,
When I added the line <cache usage="..." /> in my mapping file the configuration failed. What am I doing wrong? When I removed the above, everything load fine.


Thanks

Doug


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2003 2:34 pm 
Regular
Regular

Joined: Tue Sep 16, 2003 11:35 am
Posts: 93
Location: San Francisco, CA
i believe that ...
in 2.1 <cache> is deprecated in the mapping files. you should use class-cache and collection-cache in the hibernate.cfg.xml file.


Top
 Profile  
 
 Post subject: Any documentation on this?
PostPosted: Thu Nov 20, 2003 10:08 pm 
Regular
Regular

Joined: Thu Nov 20, 2003 10:04 pm
Posts: 64
Location: Melbourne, Australia
cutie wrote:
i believe that ...
in 2.1 <cache> is deprecated in the mapping files. you should use class-cache and collection-cache in the hibernate.cfg.xml file.


Is there any documentation on this for 2.1? What if you're programmatically configuring hibernate?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2003 10:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
<cache> is not deprecated.


Top
 Profile  
 
 Post subject: Another question then.
PostPosted: Thu Nov 20, 2003 10:27 pm 
Regular
Regular

Joined: Thu Nov 20, 2003 10:04 pm
Posts: 64
Location: Melbourne, Australia
gavin wrote:
<cache> is not deprecated.


In that case I have another question. I've added the read-only cache option to my mapping files. When I attempt to delete my objects I get:

Code:
java.lang.UnsupportedOperationException: Can't write to a readonly object


Does specifying read-only mean that I can't update my objects and if so why not? (The documentation seems a little thin on this issue).


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2003 10:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
correct.

use usage="nonstrict-read-write"


Top
 Profile  
 
 Post subject: Sorry to keep peppering you with questions but...
PostPosted: Thu Nov 20, 2003 11:04 pm 
Regular
Regular

Joined: Thu Nov 20, 2003 10:04 pm
Posts: 64
Location: Melbourne, Australia
gavin wrote:
correct.

use usage="nonstrict-read-write"


I searched all over but I couldn't find a description of the difference between read-write and nonstrict-read-write. Is there a resource you could point me to that describes this?


Top
 Profile  
 
 Post subject: described in hibernate_reference.pdf
PostPosted: Fri Nov 21, 2003 1:39 am 
Regular
Regular

Joined: Sun Sep 21, 2003 11:43 pm
Posts: 85
Location: Massachusetts
I was just looking into this for myself on Monday.It's in the www.hibernate.org online manual: http://www.hibernate.org/hib_docs/reference/html/performance.html#performance-s3 or in the hibernate_reference.pdf that should come with the distribution. It's in different sections depending on which hibernate version, 2.0.X or 2.1.betaX, you're using.

Keep in mind on 2.1 and higher, you can use (and probably should) <cache usage="..."/> instead of <jcs-cache usage="..."/>. And don't forget to set your properties:

<!-- for query caching -->
hibernate.cache.use_query_cache=true

<!-- for using jcs-cache or the cache in a class mapping -->
hibernate.cache.provider_class=net.sf.hibernate.cache.OSCacheProvider

Regards,
David


Top
 Profile  
 
 Post subject: Strict transaction isolation
PostPosted: Fri Nov 21, 2003 2:36 am 
Regular
Regular

Joined: Thu Nov 20, 2003 10:04 pm
Posts: 64
Location: Melbourne, Australia
Thanks, I don't know how I missed that. I'm not sure what "serializable transaction isolation level" means exactly. Also I still don't really get the difference between between the two after reading serveral times. Can someone with a clue please pass on their knowledge?


Top
 Profile  
 
 Post subject: 2.1 docs\reference\pdf\hibernate_reference.pdf is it better
PostPosted: Fri Nov 21, 2003 2:46 am 
Regular
Regular

Joined: Sun Sep 21, 2003 11:43 pm
Posts: 85
Location: Massachusetts
11.2.4. Nonstrict Read / Write Cache
If the application only occasionally needs to update data (ie. if it is extremely unlikely that two transactions
would try to update the same item simultaneously) and strict transaction isolation is not required, a nonstrictread-
write cache might be appropriate. If the cache is used in a JTA environment, you must specify hibernate.
transaction.manager_lookup_class. In other environments, you should ensure that the transaction is
completed when Session.close() or Session.disconnect() is called.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 4:12 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
have a look at the javadoc in the current v21branch branch in CVS


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