Solved

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

Posted on 2009-04-06
8
263 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
  • 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

785 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