Solved

asp.net app with access DB hanging because of lock file

Posted on 2009-04-06
8
266 Views
Last Modified: 2012-05-06
I've made a small asp.net app that is using access for the data. While developing on my home computer everything worked fine. I've moved it over to a company server and it was working fine for about a day and now we're having issues.
It started out by some pages not displaying some pages and the progress bar just moving very slow and then just not showing up at all. We discovered that the access lock file seems to be sticking (just staying there). I can see on my computer that when I access a page the lock file appears for a second and then disapears. On the company server, if I'm the only one that opens the web page, I can see that the lock file appears and goes away as I navigate through the pages, but, seemingly randomly, at some point the lock file does not go away.
I also have noticed that when no one is using the web pages, if I try to compact the DB, it creates a db1.mdb file, but, it doesn't go away.
Any clues as to what might be happening?
thanks for looking and your suggestions
alan
0
Comment
Question by:avoorheis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
8 Comments
 

Author Comment

by:avoorheis
ID: 24084034
btw,
I don't understand why the locking file would prevent the web file from displaying, as far as I know, the locking file does not prevent access to the data, just should prevent someone else from writing to a record that is locked (meaning someone else is trying to write to/update a record), right?
0
 

Author Comment

by:avoorheis
ID: 24084043
One other thing I'm noticing is that if the lock file starts sticking, staying there, it stays for about 10 - 15 min after closing the web page and then magically disapears.
0
 
LVL 28

Expert Comment

by:sybe
ID: 24085692
The lockfile appears when you have an open connection. Maybe your code forgets to close the connection in some files?
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

Author Comment

by:avoorheis
ID: 24087369
I don't see how. The app always closes it on my home computer and doing the exact same navigation works sometimes on the work server, but, sometimes stays locked, doing the exact same navigation.
0
 
LVL 28

Accepted Solution

by:
sybe earned 500 total points
ID: 24087624
Maybe the connections are being cleaned by the Garbage Collector, and the Garbage Collector on your home machine might be activated more frequently than ther Garbage collector on the sever (because that server might have a lot more important things to do).
0
 

Author Comment

by:avoorheis
ID: 24090790
I don't know what the garbage collector is (this is my first web application), but, would it be able to break the connection (the lock file stays after I close the browser and I can't delete the lock file).

Also, I'm using the accessdatasource objects which all look similar to (except for the query string):

        <asp:AccessDataSource ID="AccessDataSourceCommentCount" runat="server"
            DataFile="~/App_Data/HMDistProfile.mdb"
            SelectCommand="SELECT [AccountNo], [CountOfAccountNo] FROM [qryCommentsCount] WHERE ([AccountNo] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="99032660792!^13[&amp;Joh"
                    Name="AccountNo" QueryStringField="AccountNo" Type="String" />
            </SelectParameters>
        </asp:AccessDataSource>
0
 

Author Comment

by:avoorheis
ID: 24093893
maybe it's not really related to the lock file, although, it's very strange to me that when compacting the database it keeps the temp file (db1.mdb) and the original file is not actually compacted.
So, what is happening, after a little more testing, is that the webpages seem to start up ok and the first few pages seem to be working ok. You can navigate back and forth, no problem. Then there is one other page that seems to be causing the problem. When navigating to it, it loads very slow...we thought it was stuck, but, I left it there and eventually it loaded....but, while it loading, no one else can navigate to any of the pages.
0
 

Author Comment

by:avoorheis
ID: 24315870
Well, it started working correctly. Not sure why. The server is not under our control, but, apparently something was changed. Thanks for your input.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question