Board index » delphi » Problem with CachedUpdates

Problem with CachedUpdates

Hi everybody!!!
I have an application that uses TQuery components with cached updates. The
thing here is that the environment is multiuser, so I need to handle
possible record-overwriting problems. In this case, one terminal reads
record X with A field's value equals to "1" and lets the user make changes
to the record. Meanwhile, another terminal updates record X setting A
field's value to "2". After this, the first terminal tries to update the
record. An "update failed" exception is raised. My question here is: How can
I (from the OnUpdateError handler), refresh the data in the current record
so that the user can make changes to the data again and reapply??
I've tried closing and opening and repositioning the pointer in the record,
but the closing and opening generates that after the handler's code is over,
I get an "Access violation error". Is there another way to accomplish this?

thanks

--
A R I E L
[ T E A M   N E T L A N ]

 

Re:Problem with CachedUpdates


Ariel,

   Yes, that is one annoying bug with CachedUpdates, but since CachedUpdates
are no longer supported by Borland, don't look for any patches.  The
alternative is to use TClientDataSets.

http://community.borland.com/article/0,1410,22571,00.html

Good luck,
krf

Ariel Mendelzon (TeamNetlan) <siste...@kropol.com.ar> wrote in message
news:3bfa5d2d_2@dnews...

Quote
> Hi everybody!!!
> I have an application that uses TQuery components with cached updates. The
> thing here is that the environment is multiuser, so I need to handle
> possible record-overwriting problems. In this case, one terminal reads
> record X with A field's value equals to "1" and lets the user make changes
> to the record. Meanwhile, another terminal updates record X setting A
> field's value to "2". After this, the first terminal tries to update the
> record. An "update failed" exception is raised. My question here is: How
can
> I (from the OnUpdateError handler), refresh the data in the current record
> so that the user can make changes to the data again and reapply??
> I've tried closing and opening and repositioning the pointer in the
record,
> but the closing and opening generates that after the handler's code is
over,
> I get an "Access violation error". Is there another way to accomplish
this?

> thanks

> --
> A R I E L
> [ T E A M   N E T L A N ]

Other Threads