Hi Werner,
Here is my code:
Database db = null;
try {
db = JdoUtils.createJdoDb();
db.begin();
TestCaseDef tmpDef = (TestCaseDef) db.load(TestCaseDef.class,
1,Database.DbLocked);
tmpDef.setTcdLastRunTime( new Date() );
db.commit();
}
catch (Exception ex) {
db.rollback();
throw ex;
}
finally {
db.close();
}
and the mapping:
<class name= "com.est.ba.testcase.core.TestCaseDef" identity="tcdId">
<map-to table="DEV_TESTCASEDEF"/>
<field name="tcdId" type="java.lang.Long">
<sql name="TCD_ID" type ="integer" dirty="ignore"/>
</field>
<field name="tcdDesc" type="java.lang.String">
<sql name="TCD_DESC" type ="char" dirty="ignore"/>
</field>
<field name="tcdLastRunTime" type="java.util.Date">
<sql name="TCD_LAST_RUN_TIME" type ="timestamp" dirty="ignore"/>
</field>
<field name="tcdLastError" type="java.lang.String">
<sql name="TCD_LAST_ERROR" type ="char" dirty="ignore"/>
</field>
<field name="tcdLastStatus" type="java.lang.Integer">
<sql name="TCD_LAST_STATUS" type ="integer" dirty="ignore"/>
</field>
<field name="tcdStatus" type="java.lang.Integer">
<sql name="TCD_STATUS" type ="integer" dirty="ignore"/>
</field>
<field collection="arraylist" name="envs"
type="com.est.ba.testcase.core.TestCaseEnv">
<sql many-key="TCD_ID" many-table="DEV_TESTCASEDEFTOENV" name="TCE_ID"/>
</field>
<field name="exps" type="com.est.ba.testcase.core.TestCaseExp"
collection="arraylist">
<sql many-key="TCD_ID"/>
</field>
<field name="tcdes" type="com.est.ba.testcase.core.TestCaseDefToEnv"
collection="arraylist">
<sql many-key="TCD_ID"/>
</field>
</class>
After updating, TCD_DESC will change to strange value.
Thanks,
Roger
----- Original Message -----
From: "Werner Guttmann" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 30, 2004 7:06 PM
Subject: Re: [castor-dev] Bug with updating Date type field
> Roger,
>
> no, I have not seen this issue before. Can you provide a bit more information incl.
> amongst other things a code fragment, a mapping file, etc. Without any
> of these, it is going to be very hard to analyze what might be going wrong.
>
> Thanks
> Werner
>
> On Fri, 30 Jan 2004 16:49:33 +0800, ?? wrote:
>
> >Hi,
> >
> >When updating a java.util.Date type field, other fields may be changed to strange
> >value.
> >Is there anybody met this before?
> >
> >Roger
> >
> >-----------------------------------------------------------
> >If you wish to unsubscribe from this mailing, send mail to
> >[EMAIL PROTECTED] with a subject of:
> > unsubscribe castor-dev
> >
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev