Gerald Richter wrote:
> 
> $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 ?

  Aha. I'll have to think this over, but it seems to be the simplest way
to go. Thanks, Gerald. Cliff, I like your MD5 idea esp. in cases where I
don't want to mess with the DB structure, but right now I'm going to
change the DB anyway and Postgres has decent support for sequences - and
I'm already using Recordset anyway...

  - Robert

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

Reply via email to