Link to home
Start Free TrialLog in
Avatar of avoorheis
avoorheis

asked on

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

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
Avatar of avoorheis
avoorheis

ASKER

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?
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.
Avatar of sybe
The lockfile appears when you have an open connection. Maybe your code forgets to close the connection in some files?
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.
ASKER CERTIFIED SOLUTION
Avatar of sybe
sybe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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>
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.
Well, it started working correctly. Not sure why. The server is not under our control, but, apparently something was changed. Thanks for your input.