File Locking Conflicts - Are there any pitfalls ?

G

Geoffrey

We have developed a python class that can read data files created from
another application. These target files are C-ISAM files used for
accounting applications so the "primary" application may be reading
and/or writing to portions of the files ("records") at the same time.

The python class we developed opens the requested file in 'rb' mode,
reads the file header (first 512k) and using information supplied in
the file header (such as record length, etc), reads "records" from
specific file locations. At no time does the python class do any
writing of data, it is strictly read only.

Using this class we plan develop a Python application. Our app plus
the the "primary" application will reside on the same machine or at
least be using the same operating system (some flavour of win32). In
addition the primary application is "multi-user" so there may be 10-12
workstations reading/writing to the same file the the python app is
reading.

What we haven't been able to ascertain is whether or not there are any
potential "conflicts" between reading and processing the file in
python if the "primary" application also reading/writing and
processing the file.

It is our understanding that as long as the python app is "read only"
and both apps are using the same file locking mechanism (ie. the same
underlying OS), there should not be any conflicts.

If someone could point me in the right direction - comments, links,
etc - I would really appreciate it.
 
H

Heather Coppersmith

On 6 Jul 2004 06:10:08 -0700,
What we haven't been able to ascertain is whether or not there
are any potential "conflicts" between reading and processing the
file in python if the "primary" application also reading/writing
and processing the file.
It is our understanding that as long as the python app is "read
only" and both apps are using the same file locking mechanism
(ie. the same underlying OS), there should not be any conflicts.

"The same underlying OS" may not be sufficient. Your "primary"
application may have other locking mechanisms built on top of the
low-level OS-provided locks, or require that applications acquire
those locks in a particular order, or impose other restrictions.

I would check with the vendor/documentation of your "primary"
appliction; they would be the authority on a question like this.

Regards,
Heather
 
G

Geoffrey

"The same underlying OS" may not be sufficient. Your "primary"
application may have other locking mechanisms built on top of the
low-level OS-provided locks, or require that applications acquire
those locks in a particular order, or impose other restrictions.

I would check with the vendor/documentation of your "primary"
appliction; they would be the authority on a question like this.

Regards,
Heather

I am fairly certain that it is just using the filesystem locks. There
is no documentation and the vendor won't release the info. So ...

I was wondering how python addresses file locking as we can't find any
reference to this in the python manuals/docs.

Is there any modules with in python that would help me
diagnose/decipher this ?? I checked win32all and did see anything
specific to file locking.

On win32 the application provider does suggest that you "disable"
microsoft's opportunitic locking scheme as this may cause data
integrity issues.

Any hints on the python side ??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top