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: Is this really safe to do?
PostPosted: Wed Sep 08, 2004 6:55 pm 
Newbie

Joined: Wed Sep 08, 2004 5:59 pm
Posts: 5
Hibernate version:2.1.6

Mapping documents: not relevant

Code between sessionFactory.openSession() and session.close(): not relevant

Name and version of the database you are using: MySql (prolly not relevant)

Debug level Hibernate log excerpt: Not relevant

How "safe" is the following general situation? (ie anything outside of worrying about situations not covered by read committed)
--using hibernate
--using secondary cache
--using long cache timeouts
--in a clustered environment
--using nonstrict-read-write
--the cluster is the only user of the database
--actively changing data
--using versioning for optimistic locking
--every transaction starts and closes a session
--its rare for two threads/processes to be working on the same data
--the areas where it is common for two threads/processes to be working on the same data, db row locking is used at the beginning of a transaction

It is my understanding that this should be safe because:
--the secondary cache is the only user of the database and this negates the need for worrying about consistency between the cache and the database even when using nonstrict-read-write in a clustered environment.

--with nonstrict-read-write the cache maintains read committed in cache because changes do not make it to the cache until save, update, or saveOrUpdate is called. (is this true??)

--optimistic locking and versioning catches the rare case where two threads/processes are working on the same data without any row locks and throws a HibernateException


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 08, 2004 8:40 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
It is somwhat safe, but it is possible for inconsistencies to occur, because cluster replication happens asynchronously. In practice, it is unlikely that this would be a huge problem.


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.