Hello Bruce!

sorry about my confusing English. I will try to explain my problem again:

We have database tables with timestamps, database is ProstgreSQL. Timestamps 
in PostgreSQL can have a milliseconds part like in: 2002-10-05 10:15.1234+02

Now we want to map these tables to Java objects using Castor JDO using the 
following mapping:

    <class name="MyObject"
         identity="id"
         key-generator="MAX">
      <map-to table="sys_users" />
      <field name="id" type="integer">
          <sql name="id" type="integer" />
      </field>
      <field name="login" type="string">
          <sql name="login" type="char" />
      </field>
      <field name="instime" type="timestamp">
          <sql name="instime" type="timestamp" />
      </field>
    </class>

To load an object I do an OQL, than change the object using the getter/setter 
and do a db.commit();

Now the point: If the timestamp, that was originally in the database when I 
load the object has more than three digits (three, I stated two in my first 
email, that was wrong), I get the exception "Object was modfied by another 
transaction". Even when I do not change anything at the object, I get this 
exception.
That why I included the following table:

BK>klug=# select login, instime from sys_users;
BK>   login    |            instime
BK>------------+-------------------------------
BK> admin      | 2002-10-25 15:28:01.51+02
BK> klug      | 2002-10-25 15:28:01.51+02
BK> test       | 2002-10-25 15:28:01.513514+02

As you can see, the object with login "test" has one of this long milliseconds 
timestamp. Because of this, you get the exception when you get these object 
and do a commit, but not when you get one of the others.

> Because I don't completely understand your problem, so I'm going to
> paraphrase your statements. Please tell me if I'm correct or not:
>
>     - With Castor, the timestamps are not handled correctly.
Yes!

>     - With psql, the timestamps are handled correctly.
Yes again!

Hope this explanition is a little bit better. If it is nessesary, I can create 
a small sample application which reproduce the bug.

-- 
Dipl. Inform. Boris Klug, control IT GmbH, Germany

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

Reply via email to