|
Hi Werner,
Maybe I didn't exactly tell what I
mean.
I have a true case here:
Table "MMM" is the master table and table "DDD" is
the detail table.
There is a field named "detailstatus" on
"DDD".
Also, there is a field named "masterstatus" on
"MMM".
They can all have two values, one is "0", the other
is "1".
The initial values are all 0.
The logic is like this:
Every time I change a "DDD"
record's "detailstatus" from 0 to 1.
Just after this operation, I check its master
record's all detail records(including the record which I just
operated)
to see whether all the
"detailstatus" equals to 1. If this is true, I will change the
"masterstatus" from 0 to 1.
With JDBC, I can use sql "update DDD set
detailstatus = 1 where dddid = XXX",
then "select count(*) cnt from DDD where mmmid
= XXXX and detailstatus <> 1" to get what I need.
But with Castor JDO, I can only use the
setDetailstatus(1) to change the value.
Actually, this has done nothing on
the DATABASE.
So the following OQL "select t from DDD t where
t.detailstatus <> 1" will give me wrong result, except I call commit()
before the OQL.
Obviously, using two transactions may cause
problems.
So, I think there may have defect when update
in one transaction for one cannot get the changed value using
OQL.
Thanks,
Roger
|
