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...
|