MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] File Locking [tag export database]



Many thanks! For now I'll export the 'inventory.asc' when an order is placed. 
SQL will have to wait a bit, for me to figure it out, but that'll be the way 
we go in the long term. It'll be a while before we hit 100K hits-per-day. :o)

-Rob Maurer

In a message dated 10/16/99 6:57:03 PM Eastern Daylight Time, 
mikeh@minivend.com writes:

> ******    message to minivend-users from mikeh@minivend.com     ******
>  
>  Quoting Handytman@aol.com (Handytman@aol.com):
>  > 
>  > Question: Do [tag export database] and [tag flag write] 'lock' the file 
>  > before operating upon it?
>  
>  Of course.
>  
>  > 
>  > Reason For Asking: I am trying to track inventory with MiniVend. The 
code 
> on 
>  > the 'report.html' page appears to update the 'qty' field in 'inventory.
> gdbm' 
>  > but not the corresponding field in 'inventory.asc.' However, I want my 
> client 
>  > to be able to look at 'inventory.asc' and see up-to-date numbers. So...
>  > I could add [tag export inventory inventory.asc][/tag] to the 
report.html 
>  > page. That (if I understand correctly) would rewrite 'inventory.asc' 
every 
> 
>  > time an order is placed, with updated quantities. The only fear I have 
is 
> of 
>  > near-simultaneous orders getting garbled data from an unlocked, open 
file.
>  > 
>  > Then again, if I can safely rewrite 'inventory.asc' from the receipt 
page, 
> 
>  > why not just add a quantity field to 'products.asc' and rewrite *this* 
> file 
>  > with each order....Hmmm :o)
>  
>  Don't use the products table. That would hold off all catalog accesses
>  while the write was in effect. Use a small outboard table.
>  
>  SQL is best for this kind of stuff, though. While you can do some 
>  read-write operations with MiniVend DBM databases, it won't scale to
>  busy (hundred thousand hits per day or more) catalogs.


Search for: Match: Format: Sort by: