This one time, at band camp, Maxime Levesque said:

ML>Exerp from http://castor.exolab.org/locking.html :
ML>.....
ML>Access mode: Database Locked
ML>The locked mode performs optimistic locking using the underlying
ML>database engine to assure that only one transaction has access to the
ML>record. In addition to acquiring a write lock in memory, Castor performs
ML>a query with a special SQL construct (FOR UPDATE in Oracle, HOLDLOCK in
ML>Sybase) to guarantee access by one transaction.
ML>.....
ML>
ML>
ML>   What is described there is actually *pesimistic* concurency control,
ML>the advantage of optimistic concurency control is precisely the absence
ML>of locking :
...
ML>..... ok, I went to look at the sources, in :
ML>
ML>  org.exolab.castor.jdo.engine.SQLEngine {
ML>     public Object store( Object conn, Object[] fields, Object identity,
ML>                          Object[] original, Object stamp )
ML>
ML>    if ( stmt.executeUpdate() <= 0 ) { <---- here ...
ML>
ML>
ML>  and an optimistic scheme is indeed implemented, so the question now
ML>becomes, is it possible to have a mode where one relies *only*
ML>on dirty checking ? i.e. no locking whatsoever ?

Maxime,

Thank you for pointing out an error in the docs. Unfortunately there
are still some small typos like this lying around. I've fixed, many,
many things in the last couple of years, but I guess I missed that
one. I'm only human ;-).

Currently, Castor does depend on dirty checking, but there is always
some in-memory locking involved. I'm open to any suggestions you
may have regarding locking especially since I'm just beginning on
a fairly large refactoring of Castor JDO.

However, you spoke about implementing true optimistic locking via
an additional column in the database. The one thing I won't do is
force users to add columns/tables to their database schema. I am
in favor of offering such a thing as an optional feature. This is
usually known as reliable dirty checking. At one time, there was
an idea to add this feature to Castor JDO, but it's never been
added.

Bruce
--
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

The Castor Project
http://www.castor.org/

Apache Geronimo
http://incubator.apache.org/projects/geronimo.html

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to