Hi all,
I've had a problem using castor when trying to update an object that I
just created. The code below creates a LoginVO object in one Database
transaction, and then immediately following, loads that object by PK and
modifies one of the fields.
I get the following exception message thrown when i try to commit the
second database transaction :
org.exolab.castor.jdo.ObjectModifiedException: Transaction aborted:
Object of type com.intraware.vo.member.LoginVO with identity
1,230,132,541 has been modified by a concurrent transaction
Have I configured something incorrectly? Or should you be able to create
an object in one transaction, commit it, load it in another transaction
and then modify it?
Related code is below. Any Help would be very appreciated.
Thanks,
Brian
JDO jdo = new JDO();
jdo.setConfiguration(getClass().getResource("/properties/castor_config.xml").toString());
jdo.setDatabaseName("testdb");
Integer id = null;
{
Database db = jdo.getDatabase();
db.begin();
LoginVO vo = new LoginVO();
vo.setLoginIdentifier(loginIdentifier +
Long.toString(System.currentTimeMillis()));
vo.setPartnerCode(partnerCode);
vo.setPasswordValue(passwordValue);
vo.setCreateContactIdentifier(createContactIdentifier);
vo.setCreateDate(createDate);
vo.setCreateMethodCode(createMethodCode);
vo.setUpdateContactIdentifier(updateContactIdentifier);
vo.setUpdateDate(updateDate);
vo.setUpdateMethodCode(updateMethodCode);
db.create(vo);
db.commit();
db.close();
id = vo.getLoginSerialIdentifier();
}
{
Database db = jdo.getDatabase();
db.begin();
LoginVO vo = (LoginVO) db.load(LoginVO.class, id);
vo.setPasswordValue("password" +
Long.toString(System.currentTimeMillis()));
db.commit();
db.close();
}
--
Brian DeVries Sr. Software Engineer
mailto:[EMAIL PROTECTED] http://www.intraware.com
Voice: 925.253.6516 Fax: 925.253.6785
--------------------------------------------------------
Intraware... The leading provider of Electronic Software
Delivery and Management (ESDM) Solutions
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev