This is the section from the docs on Optimistic Locking.  Where do you
see anything about a cache reference?

To control concurrent access to objects optimistic locking uses a
version field on each persistent object. 


Optimistic locking is supported by all API's (PB-api, ODMG-api, JDO when
it's done). 

Optimistic locking use an additional field/column for each
persistent-object/table (Long, Integer or Timestamp) which is
incremented each time changes are committed to the object, and is
utilizied to determine whether an optimistic transaction should succeed
or fail. Optimistic locking is fast, because it checks data integrity
only at update time. 

In your table you need a dedicated column of type BIGINT, INTEGER or
TIMESTAMP. Say the column is typed as INTEGER and named
VERSION_MAINTAINED_BY_OJB. 
You then need a (possibly private) attribute in your java class
corresponding to the column. Say the attribute is defined as: 
private int versionMaintainedByOjb;in repository.xml you need a
field-descriptor for this attribute. This field-descriptor must specify
attribute locking="true" 
The resulting field-descriptor will look as follows: 
<field-descriptor
    name="versionMaintainedByOjb"
    column="VERSION_MAINTAINED_BY_OJB"
    jdbc-type="INTEGER"
    locking="true"
/> 

-----Original Message-----
From: Lemke, Wesley [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 06, 2005 1:02 PM
To: OJB Users List
Subject: RE: Is OSCache needed for Optimistic Locking?

Going to try this one more time....  :)

What is the reason that Open Symphony's cache on the tutorial page for
Optimistic Locking?  Is it a suggestion or required?

-----Original Message-----
From: Lemke, Wesley [mailto:[EMAIL PROTECTED]
Sent: Monday, May 02, 2005 8:27 AM
To: OJB Users List
Subject: RE: Is OSCache needed for Optimistic Locking?


Anyone?  Does the Open Symphony Cache handle multiple VMs where the
default impl in OJB doesn't?  Is that the reason the Optimisitic Locking
tutorial tells you to use Open Symphony?

>  -----Original Message-----
> From:         Lemke, Wesley  
> Sent: Friday, April 29, 2005 9:01 AM
> To:   'OJB Users List'
> Subject:      Is OSCache needed for Optimistic Locking?
> 
> Does the default Cache Impl in OJB 1.0.2 work with Optimistic locking?

> We are having a problem when using the Os Cache implementation, but it

> works fine with the default implementation.  Before I try to figure 
> out what's wrong, I was wondering if it would be ok to just use the 
> Default Implementation.
> 
> Thanks,
> Wes

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