Re: Cache Issue in distributed environment

2008-03-12 Thread Armin Waibel

Hi Cedric,

Cédric Talon wrote:

Hi, I am new on this mailing list and so it is my first message.



welcome to this list!



I am working on a project which is using OJB in a distributed
environment. The distributed issue is my problem ! I have read there
are important points to respect in this case.

The first one is to use Sequence Manager. It's ok for me.

The second one is the locking issue. I am using the
LockManagerRemoteImpl. So I think it is ok.


Do you use the ODMG-api implementation?
http://db.apache.org/ojb/docu/guides/odmg-guide.html
Only this implementation supports pessimistic locking by default.
The PB-api
http://db.apache.org/ojb/docu/guides/pb-guide.html
only supports optimistic locking by default.
http://db.apache.org/ojb/docu/guides/lockmanager.html

For best performance I would recommend to use optimistic locking (needs 
a 'version' column in the database table) for all concurrent modified 
persistence objects.




The last point is the cache issue. And this is the subject of this
mail. Currently I am using ObjectCacheDefaultImpl. I know it is not
suitable for distributed environment. That's why I'd like to use
distributed cache.


Here you can find a short description how the cache works
http://www.mail-archive.com/ojb-user@db.apache.org/msg16075.html
My estimation is that in most cases OJB will benefit more from a fast 
DB/DB-cache/network (in combination with a session cache) than from a 
distributed cache (except you do a lot of get object by identity stuff).

I would recommend to run some load tests with/without distributed cache.



I have heard about OS Cache but it requires a multicast network. It
is not possible in my case. I have heard about JCS too. Has anybody
ever used it? 


Sorry, I don't have experience in this.


I don't find information to configure it with OJB. Can
anybody help me ?


If you use OJB 1.0.5rc1 change the object-cache element within your 
jdbc-connection-descriptor to


one global cache region:
object-cache class=JCS
/object-cache

a cache region for each class:
object-cache class=JCSPerClass
/object-cache

For version 1.0.4 specifiy the full qualified class name (e.g. 
org.apache.ojb.broker.cache.ObjectCacheJCSPerClassImpl).


You can configure the JCS cache via the cache.ccf properties file.

regards,
Armin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cache Issue in distributed environment

2008-03-12 Thread Armin Waibel

Armin Waibel wrote:

I don't find information to configure it with OJB. Can
anybody help me ?


If you use OJB 1.0.5rc1 change the object-cache element within your 
jdbc-connection-descriptor to


one global cache region:
object-cache class=JCS
/object-cache

a cache region for each class:
object-cache class=JCSPerClass
/object-cache

For version 1.0.4 specifiy the full qualified class name (e.g. 
org.apache.ojb.broker.cache.ObjectCacheJCSPerClassImpl).


You can configure the JCS cache via the cache.ccf properties file.


Sorry, I have to clarify my last post.
I would recommend to use the two level cache with the distributed cache 
as second level cache.

If you use OJB 1.0.5rc1:

object-cache class=twoLevel
!-- ObjectCacheTwoLevelImpl attributes --
attribute attribute-name=applicationCache attribute-value=jcs/
attribute attribute-name=copyStrategy attribute-value=default/
attribute attribute-name=forceProxies attribute-value=false/
/object-cache

OJB 1.0.4:

object-cache class=org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl
!-- ObjectCacheTwoLevelImpl attributes --
attribute attribute-name=applicationCache 
attribute-value=org.apache.ojb.broker.cache.ObjectCacheJCSImpl/
attribute attribute-name=copyStrategy 
attribute-value=org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl$CopyStrategyImpl/

attribute attribute-name=forceProxies attribute-value=false/
/object-cache

regards,
Armin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]