Subject Re: [IBO] How to prevent update conflict in multiuser app?
Author Raymond Kennington
kj01135 wrote:
>
> Hi,
>
> I am developing a POS system using IBO v4.2.Ia. Suppose there are a
> three terminals on the front-end and each is doing sales order which
> in turns update the inventory records to reflect sales (decrease
> stock qty). At the same time, a manager is updating 100 inventory
> records (including ITEM A) in a batch to increase stock qty.
>
> My concerns is if this update take 5 secs to complete (using SP) and
> commit only when the 100 updates is done, if during this 5 secs ITEM
> A is sold, will the inventory data shows the correct stock qty? Will
> the SP lock the records so that ITEM A cannot be sold until it
> commits? What setting do I need in order to do this?
>
> Many thanks!
>
> Kenneth
>
Use ReadCommitted.

Upon committing, if the value of one of the records has changed then there will be an
exception raised. Catch the exception and let the manager know, rollback, and then
auto-update the original count that was read and post the additional stock values using
the SP again.

Raymond.
--
Raymond Kennington
Programming Solutions
W2W Team B