473,386 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

More file locking problems

I've been dealing with a file locking issue for a while.

Our CMS spits out a new XML file each time an item in the DB is updated.
This XML file is basically our site menu, and is what we use on the front
end to render out site's navigation, site map, breadcrumbs, etc.

We're using it because it's more efficient to just cache the XML file rather
than doing recursive DB calls on each page load.

We ran into a problem where, as far as we can tell, once in a great while,
two people would try to save the same file at the exact same time,
interupting the first file write and leaving only half of an XML file in the
filesystem, which, obviously, is invalid, thereby breaking our site.

So, we started doing file locking. If the file is being written, nothing
else is supposed to write to it. Which isn't a big deal, as the next person
to edit any other page will, in turn, update the XML file when they save.

We thought that fixed things, but now we're back to the same problem + a new
one.

So, my questions:

1) Is there any way to log/test for the incomplete XML file? I'm thinking
that one option is every time any page in the system (be it on the admin
side or public side) needs to to access the XML file, and it's invalid, that
it callse the function to rewrite it and then tries to execute again. Alas,
that seems REALLY hacky and open to all sorts of nasty logic loops.

Any other ideas?

2) Another issue is that one of the XML files that was half-written is also
now locked by another process, so I can't even write a new file if I want to
until I reboot asp.net on the server. Any way to see what is currently
locking a file?

I hope others are having a more enjoyable Friday afternoon ;o)

-Darrel
Apr 21 '06 #1
4 1572
I have a hunch that rtvscan might be the culprit (norton).

Anyone have any experience with that? I assume it may be scanning files that
are being created and then locking them.

-Darrel
Apr 21 '06 #2
Why don't you write the XML back to the database, instead of the file
system. SQL supports an XML datatype, or just save it as text

Jeff
"darrel" <no*****@nowhere.com> wrote in message
news:e8**************@TK2MSFTNGP03.phx.gbl...
I've been dealing with a file locking issue for a while.

Our CMS spits out a new XML file each time an item in the DB is updated.
This XML file is basically our site menu, and is what we use on the front
end to render out site's navigation, site map, breadcrumbs, etc.

We're using it because it's more efficient to just cache the XML file
rather than doing recursive DB calls on each page load.

We ran into a problem where, as far as we can tell, once in a great while,
two people would try to save the same file at the exact same time,
interupting the first file write and leaving only half of an XML file in
the filesystem, which, obviously, is invalid, thereby breaking our site.

So, we started doing file locking. If the file is being written, nothing
else is supposed to write to it. Which isn't a big deal, as the next
person to edit any other page will, in turn, update the XML file when they
save.

We thought that fixed things, but now we're back to the same problem + a
new one.

So, my questions:

1) Is there any way to log/test for the incomplete XML file? I'm thinking
that one option is every time any page in the system (be it on the admin
side or public side) needs to to access the XML file, and it's invalid,
that it callse the function to rewrite it and then tries to execute again.
Alas, that seems REALLY hacky and open to all sorts of nasty logic loops.

Any other ideas?

2) Another issue is that one of the XML files that was half-written is
also now locked by another process, so I can't even write a new file if I
want to until I reboot asp.net on the server. Any way to see what is
currently locking a file?

I hope others are having a more enjoyable Friday afternoon ;o)

-Darrel

Apr 21 '06 #3
Well, killing asp.net and forcing it to restart released the file, so I
suppose it's an issue with my application. I'm obviously missing a proper
FINALLY statement in a try/catch somewhere...

-Darrel
Apr 21 '06 #4
> Why don't you write the XML back to the database, instead of the file
system. SQL supports an XML datatype, or just save it as text


Hmm...ya know, that might be the best way to go about this.

The reason we were using the XML file was that it was easily cached by the
system. I can easily check to see if the file has been updated, and, if not,
just use the cache.

I assume with the DB solution, I'd have to always query the DB on each page
load to see if it's a new file (or is that assumption wrong)?

-Darrel
Apr 21 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Kyler Laird | last post by:
I've been using Unison http://www.cis.upenn.edu/~bcpierce/unison/ for awhile and it causes me a lot of grief. I'd love to have a Python version which would be vastly easier to modify. Anyone...
3
by: Ryan | last post by:
I have a problem with record locking / blocking within an application. The app is quite straight forward. Written in Delphi 5 using BDE to access a SQL 7 database (Win2K server). Every so often...
3
by: Wolfgang Bachmann | last post by:
We migrated a database from Version 5.1 to 8.1 and are experiencing massive locking problems. We migrated in the following steps: 0) Server 5.2, Clients 5.2: everithing was fine 1) Server 5.2,...
3
by: TR | last post by:
Hi, Just wondering if there are any issues involved with using the same names for access files of different types, ex. filename.MDW and filename.MDB. When these are both in use and reside in the...
0
by: Andrew Dowding | last post by:
Hi Everybody, I have been looking at problems with my Windows Forms C# application and it's little Jet 4 (Access) database for the last few days. The Windows Forms app implements a facade and...
5
by: marcello | last post by:
Hello I need to do this: 1 opening a file for writing/appending 2 to lock the file as for writing (i mean: the program that lock can keep writing, all others programs can't ) 3 wtite and...
9
by: master | last post by:
Actually, it is not only the record locking, what I need, and nobody seems to descibe this. Imagine the following scenario. There is a database with, say 10000 records with some unvalidated...
13
by: George | last post by:
Hi, I am re-writing part of my application using C#. This application starts another process which execute a "legacy" program. This legacy program writes to a log file and before it ends, it...
4
by: John please don't spam me! | last post by:
VB.Net 2003 Hi, 2 questions: 1. I want to read a file in without locking it, as it is Log file. 2. I want to be able to read from the last point it wa read upto. The project is: Search...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.