baanconsultant
19th May 2005, 13:07
Hi,
I have a dal on a table with years and turnover for every year and customer. There is one Record per year (in the same table) for which the customer is not filled. This record holds the unallocated turnover.
If I add a record to the table for a specific customer and year, the unallocated turnover should be recalculated.
Environment is Baan ERP 5.0 c on Solaris with Oracle as database.
I did the following:
In the after.save.object (persuming that the db.update for the record with the customer has taken place here), I make a select on the record (delayed lock) without customer, subtract the turnover of the record with the customer in it, and do a db.update on the record without the customer.
I get a "201 record changed after delayed lock" and I do not get it why.
The code (simplified)
after.save.object:
select *
from alcom001 for update
where alcom001._index1={"",:year}
selectdo
alcom001.tovr = tovr
db.update(talcom001,db.retry)
endselect
I put the code in a dll but (as I explected) this didn't change anything. Playing around with retry points or commits didn't bring anything.
Any ideas?
I have a dal on a table with years and turnover for every year and customer. There is one Record per year (in the same table) for which the customer is not filled. This record holds the unallocated turnover.
If I add a record to the table for a specific customer and year, the unallocated turnover should be recalculated.
Environment is Baan ERP 5.0 c on Solaris with Oracle as database.
I did the following:
In the after.save.object (persuming that the db.update for the record with the customer has taken place here), I make a select on the record (delayed lock) without customer, subtract the turnover of the record with the customer in it, and do a db.update on the record without the customer.
I get a "201 record changed after delayed lock" and I do not get it why.
The code (simplified)
after.save.object:
select *
from alcom001 for update
where alcom001._index1={"",:year}
selectdo
alcom001.tovr = tovr
db.update(talcom001,db.retry)
endselect
I put the code in a dll but (as I explected) this didn't change anything. Playing around with retry points or commits didn't bring anything.
Any ideas?