hi,
i created a simple persistent class TextValue
public class TextValue
{
public String id = null;
public String value = null;
public TextValue()
{
}
public String toString()
{
return value;
}
}
i am using oracle 8.1.7 as database.
when creating a TextValue object with value set to an empty string ("") and
set the id field without key generator
...
db.begin();
TextValue text = new TextValue();
text.id = "test";
text.value = "";
db.create( text);
db.commit();
db.begin();
text = (TextValue)db.load( TextValue.class, "test");
text.value = "a sample value";
db.commit();
...
i get an error on next update of the object:
Castor: Creating TextValue (test)
Castor: Loading TextValue (test)
Castor: Storing TextValue (test)
org.exolab.castor.jdo.ObjectModifiedException: Transaction aborted: Object
of type TextValue with identity test has been modified by a concurrent
transaction
at org.exolab.castor.jdo.engine.SQLEngine.store(SQLEngine.java:867)
at org.exolab.castor.persist.ClassMolder.store(ClassMolder.java:1584)
at org.exolab.castor.persist.LockEngine.store(LockEngine.java:758)
at
org.exolab.castor.persist.TransactionContext.prepare(TransactionContext.java
:1457)
at org.exolab.castor.jdo.engine.DatabaseImpl.commit(DatabaseImpl.java:499)
at ora_test.run(ora_test.java:52)
at ora_test.main(ora_test.java:63)
Exception in thread "main" Normal Termination
but when using a key generator for the id field everything is fine !!
i used the cvs version 2001/12/27.
hope the appended testcase helps fixing the bug.
thanks,
lars
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev