473,804 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1589
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*****@nowher e.com> wrote in message
news:e8******** ******@TK2MSFTN GP03.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
3401
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 know of anything like this? It doesn't seem like it should take a lot to sit on top of rsync and resolve conflicts. I see that someone implemented rsync in Python and that there's a SWIG wrapper for librsync.
3
5128
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 the users (when they bother to tell me) find that the application locks up and they are unable to work. No errors are produced (error trapping in the app is good). They 'shout round' to each other and get someone to exit the data entry screen....
3
2770
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, Clients 6.1: everything still fine 2) Server 8.1, Clients 6.1: here the problem occurs 3) server 8.1, Clients 8.1: not yet done. Steps 1 & 2 were nessecary because there are to many clients spread over to much area to migrate all at once from...
3
1277
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 same directory, Access creates one LDB file, filename.LDB. Are there any potential problems with this scenario?
0
3172
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 implementation, data abstraction layer. But because each data adapter in the implementation layer has a connection object that opens and closes as needed, I found I got several errors from the Jet engine when there were simultaneous connections to...
5
12317
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 close/unlock Even better would be changing the order of steps 1 and 2 (that is,first locking than writing, but it seems to me that in order to block i need the id of the file...)
9
2660
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 data. And there is an Intranet ASP.NET application which is an interface to the database in question... and there are 100 pretty girls eager to... uhmm... use the application and validate the data of course ;-). The task is to enable the data...
13
11160
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 writes a specific string to the log file. My original program (MKS Toolkit shell program) which keeps running "grep" checking the "exit string" on the "log files". There are no file sharing problem.
4
9563
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 through ftp log files for certain files download to our ftp site. This will be on a schedule so I would like to pass to my database the point (in bytes) where I have read upto. Then next time I check it I want to only
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10351
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9174
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7638
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6866
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.