Re: Attempted Simultaneous Access causes "Could not lock file"



Siegfried Heintze wrote:

Hmmm.... the ASP.NET application is only reading.

I can have multiple perl programs writing to the database, simultaneously. I
wrote both programs. One of the most important features of a database, I
thought, was simultaneous access by multiple processes.

No. Any simultaneous "write" access is only to different parts of the same database, such as separate records. If two processes attempt simultaneous changes to the same field, someone's work is likely to be trashed -- the field will contain only one value at the end, regardless of how many processes tried to change it.


In Access, multiple processes might access separate records, but any one record is modifiable by only one process at a time, and it must release the record before the other process can change it. (It often doesn't even make sense for the 2nd process to have read-only access to the record, as the fields could easily be inconsistent up to the time the 1st process finishes writing and releases the record lock.)

The perl code is just doing "INSERT"s and the ASP.NET is only doing Selects.
Is there not some setting that needs to be adjusted to allow multiple
readers and writers?

I don't know, but my guess is that Perl needs to explicitly release each record after it finishes writing that record. Perhaps it's neglecting to unlock records.


Is all this behavior new? If it is, did you change some of the code just before you noticed it? You might want to return to a previous version to try to identify the cause of the problem.

I understand that the MSAccess GUI needs exclusive access when editing a
table definition, but I'm not doing that.

It probably needs exclusive access to the entire Table if it's modifying the Table's structure! I'd want exclusive access to the entire database if I were doing that, and for long enough to check the results for accuracy and consistency.


But for editing the contents of a set of records, you probably need exclusive access only to the records being modified. Are you defining transactions on which you may at times perform Commit or Rollback operations? Any resources (e.g. records in Tables) involved in those will temporarily belong exclusively to some process, I expect.

If the ONLY operation that any process wants to perform is reading, then there shouldn't be any need for any exclusive access. But you said that the Perl code is writing, too, so it does need to exclude other processes. I think the main question is how it's accomplishing that, and under what conditions it allows other processes to read.

Thanks,
Siegfried


"Vincent Johns" <vjohns@xxxxxxxxxxxxxxxxxx> wrote in message news:qk5%e.1297$4h2.97@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Siegfried Heintze wrote:


I have a screen scraper written in perl that populates the same database
every night with new additional information.

Why is it that when I try to simultaneously write to the database with

perl

and read it with my ASP.NET UI I get "could not lock file" from ASP.NET?

Thanks,
Siegfried

I don't know the details of your system, but this behavior seems quite reasonable. If ASP.NET needs exclusive use of some resource (such as your database), and some other process currently has access to the resource, then ASP.NET should definitely have to wait until nobody else is using it. Maybe you can schedule the activities for different times.

  -- Vincent Johns <vjohns@xxxxxxxxxxxxxxxxxx>
  Please feel free to quote anything I say here.
.



Relevant Pages

  • Re: Exclusive Access to DAO 3.5 Database
    ... > I'm writing a database application which could have multiple instances ... > instance has exclusive access so it can perform maintenance tasks. ...
    (microsoft.public.vb.database)
  • Exclusive access
    ... I started writing a database in Access 97 and then ... I get a message saying that I don't have exclusive access ... Any explanation/workaround would be appreciated. ...
    (microsoft.public.access.security)
  • Re: Bit flipping .. will this work in VB6?
    ... such as you or another programmer on the project writing ... reporting some odd behavior can send me the file they are working on, ... in the database even though they had 190gig free on the hdd. ... If you're writing a financial app though.... ...
    (microsoft.public.vb.general.discussion)
  • Re: Multiple databases - best performance scenario
    ... My company has the need to manage data for multiple customers. ... Multiple small physical servers connected to SAN ... When I'm using the word database ... You might consider checking licensing costs at the oracle store ...
    (comp.databases.oracle.server)
  • Re: Problem with VBA created subform in Access 2007
    ... machine not be seeing the delay in the DB. ... User-authorization for exclusive database access. ... default open mode set to exclusive access, ...
    (microsoft.public.access.modulesdaovba)