Hi Thomas,

Thomas Phan wrote:
> Hi,
>
> In a single web site + load-balanced/cluster environment, if I have more
> than 1 servlet engines (different VMs/HTTP sessions), each runs an OJB
> instance, and 1 shared database, what OJB mode should I configure to get the
> data cached (clear for all dirty cache automatically), synchronized, and
> obtain unique sequence?


1. Use optimistic locking (OL) to let OJB handle write conflicts between servlet engines.
To use OL define a TIMESTAMP or INTEGER column and the respective Java
attribute for it.
In the field-descriptor of this attribute set the attribute
locking="true"


2. Think about caching. As you are using OL using a local cache will tend to hold more and more invalid data over time. This will decrease performance as more and more OL-Exceptions must be handled.
you can either
a) turn off caching complety by using the EmptyCacheImpl
b) use the ObjectCachePerBrokerImpl and clear the local caches frequently.
c) Use the JCS cache implementation (see OJB.properties).
JCS provides synchronisation mechanisms for distributed caches.
Please have a look at the JCS site for configuration details.



3. Use a SequenceManager that is safe across multiple JVMs. The NextVal
based SequenceManagers or any other SequenceManager based on database
mechanisms will be fine.
I am not sure if the HighLowSeqMan is guaranteed to be safe across several JVMs


> Is that something like the C/S mode? but all HTTP requests go to the cluster
> of PB servers (no PB clients will exist in this case?)


The OJB c/s mode was meant to separate the persistence broker layer from
the Application layer (in your case the servlet container).
But as servlet and EJB based apps are quite scalable by virtue of the
respective containers, it just does not make much sense to introduce
another layer.

That's why we dropped the c/s mode. It won't be there in the 1.0
release. In fact it's already ereased from CVS!

cheers,
Thomas

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




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



Reply via email to