Subject | Re: [IBO] How to prevent update conflict in multiuser app? |
---|---|
Author | kj01135 |
Post date | 2002-11-16T08:52:44Z |
Hi Raymond,
Thanks for your quick response.
Do you mean when the SP is about to commit and it detects the ITEM
A's qty is different (after sold), then an exception will be raised
and the whole update process need to rollback (ie rollback the
100 records)? If this SP is executed again after the rollback, then
another records (ITEM B) might cause the conflict again.
What do you mean that "auto-update the original count that was read
and post the additional stock values using the SP again."?
Kenneth
Thanks for your quick response.
Do you mean when the SP is about to commit and it detects the ITEM
A's qty is different (after sold), then an exception will be raised
and the whole update process need to rollback (ie rollback the
100 records)? If this SP is executed again after the rollback, then
another records (ITEM B) might cause the conflict again.
What do you mean that "auto-update the original count that was read
and post the additional stock values using the SP again."?
Kenneth
--- In IBObjects@y..., Raymond Kennington <progsol@c...> wrote:
> 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