You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Peter Schröder <Pe...@freenet-ag.de> on 2007/04/19 14:14:20 UTC

level 3 caching

hi,

i am currently investigating the use of cayennes cross jvm caching with jgroups, shown here 
http://cayenne.apache.org/doc12/object-caching.html
and here
http://cayenne.apache.org/doc12/configuring-caching-behavior.html

my question is, if it is possible to implement a cross-jvm counter, that wont be bitten by concurrency issues.

f.e.:

synchronized incrementCount(){
   myObject.setCount(myObject.getCount() + 1) 
}
 
if properly used, this would be sufficent in a single jvm to avoid issues. 
can i achieve something like that within level-3-caching?

kind regards,
peter

Re: level 3 caching

Posted by jerome moliere <je...@gmail.com>.
2007/4/19, Peter Schröder <Pe...@freenet-ag.de>:
>
> hi,
>
> i am currently investigating the use of cayennes cross jvm caching with
> jgroups, shown here
> http://cayenne.apache.org/doc12/object-caching.html
> and here
> http://cayenne.apache.org/doc12/configuring-caching-behavior.html
>
> my question is, if it is possible to implement a cross-jvm counter, that
> wont be bitten by concurrency issues.
>
> f.e.:
>
> synchronized incrementCount(){
>    myObject.setCount(myObject.getCount() + 1)
> }
>
> if properly used, this would be sufficent in a single jvm to avoid issues.
> can i achieve something like that within level-3-caching?


for concurrent issues , I highly suggest using the java.util.concurrent or
(the old package from doug lea if JDK < 1.5) , it provides many high level
abstractions (  Barrier,Mutex ...) ...

another way for resolving your problem could be to put in place a JVM
clustering tier with OpenTerracota...Don't know if someone ever tried with
Cayenne..I should bring transparent cross JVM caching...

HTH
Jerome




-- 
Jerome Moliere - Mentor/J
http://romjethoughts.blogspot.com/
auteur Eyrolles