Subject | Re: [firebird-support] Read uncommitted |
---|---|
Author | Milan Babuskov |
Post date | 2010-08-17T09:57:47Z |
Hello Jarrod, I'm using a similar system in one of my applications, but
with minor modifications:
Jarrod Hollingworth wrote:
attachment ID as a field in the table, and I check if the client is
still connected via MON$ATTACHMENTS. Rows for clients that "lost
connection" without cleaning up their rows (delete) are ignored. If
order is canceled, rows are deleted anyway (as you note in steps 5 and 7).
transactions for all the inserts and try to repeat from application in
random short intervals.
HTH
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================
with minor modifications:
Jarrod Hollingworth wrote:
> 1. Add a Stock_Reserve table with columns for order id, stock id, quantity,No need for 1-hour limit, just read everything. I'm using client
> reserve date-time, salesperson id, terminal id.
> 2. When checking stock levels subtract the SUM of Stock_Reserve quantity for
> all rows where matching stock id and reserve date-time less than 1 hour,
> from the actual Stock quantity.
attachment ID as a field in the table, and I check if the client is
still connected via MON$ATTACHMENTS. Rows for clients that "lost
connection" without cleaning up their rows (delete) are ignored. If
order is canceled, rows are deleted anyway (as you note in steps 5 and 7).
> 3. When adding a line item for the order insert and commit a row toI just do UPDATE stock SET quantity = quantity - :order_quantity.
> Stock_Reserve with the quantity required.
> 4. When the order is complete i] update Stock with adjusted quantity where
> current quantity = expected original quantity. If update affects zero rows
> you need to re-read Stock and re-calculate and try again,
> 5. If order is cancelled delete Stock_Reserve rows for the order.Same comment as with step 2.
> 6. Pending orders time-out and are automatically cancelled after 1 hour.
> 7. On application startup delete Stock_Reserve rows (all, or only older thanAll I can say that this system works rather well. I'm using NO_WAIT
> X mins, or just for the terminal or salesperson, depending on whether
> "application" is the central system or a client instance and how you want to
> clear them in the event of a crash/system restart/outage).
transactions for all the inserts and try to repeat from application in
random short intervals.
HTH
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================