>
>   This definitely saves the overhead of passing around another version
> of data, but requires a modification of all table structures. I don't
> see how it can be done with a Recordset filter, could you give me a
> clue?
>

$db -> TableAttr ($tabname, '!Filter', {  '\\updatecnt' => [ sub
 'updatecnt_seq.nextVal' }, undef, DBIx::Recordset::rqUPDATE ] }) ;

This assumes that you have a database that has sequences (Postgres, Oracle)
and you take the next number out of the sequence. If your db doesn't have a
sequence you can return a number from the DBIx::Recordset sequnce classes.
The above filter will always be executed on every update so it makes sure
you always get a new number.

So now you select your record, pass the value of the updatecnt field to the
next page. When it comes to an Update you simply say

UPDATE ..... WHERE id = $id and updatecnt = $passed_updatecnt ;

If the the updatecnt is still the same, it works, if not no record will be
updated and you know somebodyelse has done so inbetween...

What you think about this ?

Gerald



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to