Hi all!

First, I'll describe my DB configuration and mapping.

All my objects are inherited from base object, DBObject.
It is mapped to table named "objects".
Fields are:
    Column     |       Type        | Modifiers
---------------+-------------------+-----------
 id            | integer           | not null
 name          | character varying |
 parent_id     | integer           |
 creation_date | bigint            |
 remove_date   | bigint            |
 update_date   | bigint            |
 class         | character varying | not null


I have class , inherited from  DBObject, let's call it ExternalSystem.
It is mapped to table "system"
fields:
   Column   |  Type   | Modifiers
------------+---------+-----------
 id         | integer | not null
 last_sync  | bigint  |
 checkpoint | bigint  |

Objects of this type, ExternalSystem, take part in very long transactions,
which lasts about 5 hours.

Actions performed during the transaction:
1)load the ExternalSystem by its name( using OQL ), I have an instance of
the ExternalSystem.
2)IMPORTANT - at the same time another transaction reads the same object to
show its parameters on screen, no changes made.
3)perform long lasting actions
4)set checkpoint on ExternalSystem - ExternalSystem.setCheckpoint( now ) -
last time the system was processed.


  There is an ObjectFactory implemented in the program.
It operates with TransactionContext and ObjectCahe. All objects, loaded
during current transaction, are placed in the TransactionContext, so we can
reuse such objects without reloading. ObjectCahe contains all objects loaded
at any time.
Mapping for DBObject :
  <class name="DBObject" identity="id" key-generator="common">
    <cache-type type="none"/>
    ....fields......
  </class>
So, my cache replaces castor's cache functionality.

 ________________HERE IS THE DESCRIPTION OF MY PROBLEM______________
I tried all types of castor cache to work(of course, I turned my cache
completely off)
And when trying to read the   ExternalSystem in main , long-lasting thread
(I want to set new checkpoint time value),
I have an error message:
org.exolab.castor.jdo.ObjectModifiedException: Transaction aborted: Object
of type DBObject with identity 16 has been modified by a concurrent
transaction
        at org.exolab.castor.jdo.engine.SQLEngine.store(SQLEngine.java:867)
        at org.exolab.castor.jdo.engine.SQLEngine.store(SQLEngine.java:768)
        at
org.exolab.castor.persist.ClassMolder.store(ClassMolder.java:1573)
        at org.exolab.castor.persist.LockEngine.store(LockEngine.java:759)
        at
org.exolab.castor.persist.TransactionContext.prepare(TransactionContext.java
:1436)
        at
org.exolab.castor.jdo.engine.DatabaseImpl.commit(DatabaseImpl.java:499)
        at ObjectFactory.commit(ObjectFactory.java:101)


I guarantee that another transaction did not change the object, only read,it
even does rollback() call.

When <cache-type type="none"/> and my cache is on, everything works.

Where is the problem, and how can I move to castor cache without this
problem ?

Thanks in advance!

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

Reply via email to