MiniVend Akopia Services

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

Re: cooperation between existing Perl cgi programs and Minivend possible?



Quoting Philip Tsai (tsailipu@yahoo.com):
> 
>  So I take it as it means that as long as both the external Perl and MV
> are using a SQL database, one doesn't have to worry about
> sharing/locking the DB, since the SQL environment will take care of
> that automatically....
>  
> > 
> > MiniVend's internal databases would require locking
> > (or access by using
> > its modules). It does honor file locks on the ASCII
> > files so you could directly
> > access those if you wanted without too much fear of
> > corrupting the databases.
> 
>   This is where my question comes in.  If the external Perl scripts
> just want to use MV's internal DB file (.asc/.gdbm), then either the
> Perl script can simply lock the .asc/.gdbm (using Perl's own file
> locking mechanism) when updating it, or the Perl script can "use" the
> MV modules and call MV's internal file locking function to help lock
> the .asc/.gbdm.  Is this interpretation correct ?  In such cases, does
> one need to lock both .asc AND .gdbm, or I take it as you mean that one
> can simply lock the .asc file and MV will honor this lock even if MV is
> updating/accessing the corresponding .gdbm file ?  If this is the case,
> I suppose MV, before accessing/updating the corresponding .gbdm file,
> always checks for locks on the .asc file first (?).  

On second thought, use SQL. First of all, you should NEVER touch the
GDBM files unless you intimately understand the MV source.

You could update the ASCII files if:

	1. They are small.
	2. You never write the GDBMs with MiniVend without exporting
	   to ASCII in the same page. This means you probably never want
	   to touch userdb.asc!
	3. You test, test, and re-test with a test catalog before going live.

Use SQL.

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
Any man who is under 30, and is     131 Willow Lane, Floor 2  | ||  _ \
not liberal, has not heart; and     Oxford, OH  45056         | || |_) |
any man who is over 30, and is not  <mikeh@minivend.com>     |___|  _ <
a conservative, has not brains.     513.523.7621 FAX 7501        |_| \_\
 -- Winston Churchill              


Search for: Match: Format: Sort by: