Hi all,

I'm experiencing a stange behaviour of castor, 
where it 
     accepts number from a sqlDB with 1 decimal (12.5), 
     but not with 2 (12.52).
The error message does not correspond to the problem at all (see below)


---------------------------

The story :
Due to the euro currency changes, some prices have now received a 2nd decimal.

Kaboum : 
   after changing any value of a record that has 1 field 
   with  2 decimals,
   the following 'commit' causes

   org.exolab.castor.jdo.ObjectModifiedException: 
   Transaction aborted: 
       Object of type xxxx.Stage with identity 3 
       has been modified by a concurrent transaction


It doesn't make sense to me :

1/ in the DB, the value is stored in a double :

        base_price double DEFAULT '0' NOT NULL,

2/ in mapping.xml and java, it's a double too :

      <field name="basePrice"  type="double"  > 
            <sql  name="base_price" /> 
      </field>


------------------------------------------------------------------------------------

The simplest test that reproduces the problem :

        db.begin();
            stage_3     =   Stage.get(db, 3) ;
            stage_3.setAccountCard("qsdf")  ; // could be any other field, 
                                             of any type

        db.commit(); => throw exception



case 1: in the DB, I set the basePrice value to 12.5
        => OK (1 decimal)

case 2: in the DB, I change the basePrice value to 12.52
        => fail  (2 decimals), 
           with the following stact trace :



   org.exolab.castor.jdo.ObjectModifiedException: 
         Transaction aborted: Object of type 
           cirb.tele.project.jjjynetv2.dataModel.Stage 
           with identity 3 has been modified by a concurrent transaction
        at org.exolab.castor.jdo.engine.SQLEngine.store(SQLEngine.java:873)
        at org.exolab.castor.persist.ClassMolder.store(ClassMolder.java:1544)
        at org.exolab.castor.persist.LockEngine.store(LockEngine.java:745)
        at 
org.exolab.castor.persist.TransactionContext.prepare(TransactionContext.java:1162)
        at org.exolab.castor.jdo.engine.DatabaseImpl.commit(DatabaseImpl.java:498)Hi 
all,


Has anybody ever experienced this problem?

Alain Ravet

This mail has been checked by exiscan.
To be safe, please scan the mail attachements with your local virus scanner !

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

Reply via email to