Can I ask a dumb question:

Why?

Why - as in why the first-level cache in Hibernate is not pluggable ?

Then the answer is:

The first-level cache is a very specialized context that is very crucial for Hibernate to work. "first-level cache" is also generic term used to explain people *one* of the
primary functions of the Session.

The first level cache in Hibernate is basically the Session (or more precise the PersistenceContext) and this "beast" is more than just a basic "cache" and even considering having
this stuff in a cache such as ehcache, jbosscache etc. does not make sense.

For one thing it has to ensure session scope identity of objects and thus these objects are in no way "shareable" with others. Something that sets it apart from what a normal
cache is actually used for.

I can very much recommend Chapter 5 (especially 5.3.2) in HiA about this particular subject.

(In theory we could provide pluggability for the Session/PersistenceContext but no
practical need have been presented...)

/max

-Andy

Max Rydahl Andersen wrote:

> Sounds good to me. My next question is how do we tell Hibernate to use
> JBoss Cache as the first level cache?

*first* level cache ? Why would you ever want that ?

You mean second level cache, right ?
I mean first level cache, which by default is using ehcache-1.1.jar (jira JBAS-2868). We don't include ehcache-1.1.jar with the 4.0.4 as
Again - Hibernate does not support pluggable first level cache; only the second level cache is pluggable. and yes ehcache is the default *second* level cache as currently that is the best available default singleprocess cache.
 Mannik is the one who has the details about the current state of having
JBossCache work as an efficient single process cache with hibernate.
  /max




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development
   ----
Max Rydahl Andersen
callto://max.rydahl.andersen
 Hibernate
[EMAIL PROTECTED]
http://hibernate.org
 JBoss Inc
[EMAIL PROTECTED]
  -------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development





-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development



--
--
Max Rydahl Andersen
callto://max.rydahl.andersen

Hibernate
[EMAIL PROTECTED]
http://hibernate.org

JBoss Inc
[EMAIL PROTECTED]


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to