-->
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: Could someone please clarify my confusions about concurrency
PostPosted: Thu Apr 08, 2004 7:29 pm 
Newbie

Joined: Tue Sep 30, 2003 10:08 am
Posts: 7
Location: Turkey
Hello, I'm relatively new to middleware architectures and programming, and I still am trying to understand some basic points about enterprise middleware architectures... First of all some remarks, in order to know if I understood things right..

1. Hibernate uses a per request cache(in case you do not disconnect and reuse the Session between requests. So a request level cache is the default behavior.)
2. This means that all concurrency checking is left to the underlying db and Transaction Isolation Levels you set on the app server. That means for example, if I use a read_commited Isolation level(On Session Beans)
a client may see stale data when I do not use version checking on records...For a repeatable read transaction, the client cannot recognize any newly inserted or deleted data(When I read the data with a shared lock and when I upgrade it to an exclusive lock while updating the record).
3. Hibernate can also use a JVM level or clustered cache, and eh-cache is the default.. If my former remarks are right, here lies the madness for me.. Does eh-cache employ all these concurrency issues(holding and releasing shared or exclusive locks)... I inspected the source code of eh-cache a little, but did not recognize anything to handle such kind of complex logic... So, I would be grateful if someone could shed a light on me how to beahve and what things to consider in a JVM level cache, because I have to provide a performant and at some parts heavily transactional application on a relatively weak hardware...
4. In Hibernate reference, it is told that eh-cache should never be used if a Serializable Isolation level is needed. That's also another thing that I cannot comprehend why. The answer may well be relative to my former questions.. I'd appreciate it if someone could enlighten this issue for me..
5.At Hibernate docs, there are two concepts, which I do not clarify the meaning. A Transactional cache, and a read-write cache... It is told that JBoss cache is transactions, but eh-cache is a read-write one... Could anyone tell me what a transactional and read-write cache means and give some clues about what guidelines I must follow?(Does a transactional cache mean a clustered cache while a read-write cache means a JVM level cache?)

Thanks in advance...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 08, 2004 7:40 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You have mixed very different concepts in your posting, I don't see a way to answer that in a few short sentences. Please read first about:

1. Transaction handling for SQL database (isolation levels)
2. Locking techniques (shared lock, exlusive lock)
3. Optimistic concurrency control (version checking)

You can (and should) study these topics without Hibernate. Then, try to understand how Hibernate uses these techniques to implement concurrency control and transaction isolation (which is pretty much a thin layer on top). The cache is a different topic and you should not try to understand it before you know the basics.

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


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.