Subject | Re: [firebird-support] Read uncommitted |
---|---|
Author | Gustavo |
Post date | 2010-08-17T01:57:39Z |
I think you are supposing there is one register for each piece of product A. If there is a stock of 100 pieces of product A, there are NO 100 registers in a table to lock or unlock. There is only one register with a field STOCK with the value 100. So I can´t do what you suggest.
Even there are products which unity of measurement is not "pieces". For example, there may be 127,69 meters of stock of some product and perhaps in an order the seller 1 wants to use 74,52 meters.
Even there are products which unity of measurement is not "pieces". For example, there may be 127,69 meters of stock of some product and perhaps in an order the seller 1 wants to use 74,52 meters.
----- Original Message -----
From: Alan McDonald
To: firebird-support@yahoogroups.com
Sent: Monday, August 16, 2010 10:31 PM
Subject: RE: [firebird-support] Read uncommitted
> Thank you for your answer Alan.
>
> If I understand, what you suggest might work when products are "unique"
> (that is, there is only one of each product), but this is not my case.
> I will give an example.
>
> There are a stock of 100 pieces of product A.
>
> Seller 1 is making an order and he inserts a line which includes 70
> pieces of product A.
>
> Seller 2 is making another order and he tries to insert a line which
> includes 50 pieces of product A. The application should tell him there
> is no enough stock because at that moment there are only 30 pieces
> available (100 - 70).
>
The same logic would apply with an additional step of counting the un-locked
items, then if there is enough for the order, locking the first N items with
the update statement until the commit unlocks them and marks them sold.
Alan
__________ Información de NOD32, revisión 5371 (20100816) __________
Este mensaje ha sido analizado con NOD32 antivirus system
http://www.nod32.com
[Non-text portions of this message have been removed]