hi thomas,

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

i'm using PB to update the database. since it doesn't keep the state, i
tried that PB only increments the INTEGER without generating the exception.
should we manually

i) start a new transaction
ii) find the current object by the object to be modified's indentity
iii) compare the 2 integers (in the current and new objects), and throw the
exception, and rollback if they r not match
iv) mark some children objects to be deleted recusively (fix the fact that
PB doesn't delete children records)

prior to calling store, and commit? does this approach safe within a
transaction?

thanks for your suggestions. i'll have a look at the JCS later :)

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


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

Reply via email to