Article View: borland.public.jbuilder.java.swing
Article #1581File locking
From: Craig Wilson
Date: Wed, 15 Oct 2003 17:31
Date: Wed, 15 Oct 2003 17:31
13 lines
1869 bytes
1869 bytes
I'm using xml files as a sort of database, with Castor doing the reading and writing. I want to make the program multiuser, so that when one user accesses a certain piece of data, no one else can edit it, until the first guy is done with it. The method I'd like to try is to have a text (preferably xml) file that would contain a list of locked data elements. When you are ready to work on some data, you would have to open that file and check to make sure that data element isn't listed. If it's there, show a please try again later message, otherwise write that data element to the file and proceed, then remove that element from the file when finished with it. But for that to be safe, only one person can be allowed to have the file open at any one time. Is there a way to lock the file for this purpose? Or any other suggestions would be appreciated. Craig
Technical Details
Message-ID:
<3f8d8436@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed1.easynews.com!easynews.com!easynews!newsfeed.hal-mli.net!feeder2.hal-mli.net!in.100proofnews.com!in.100proofnews.com!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,b88831aa14954b88,start X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2003-10-15 10:41:16 PST From: "Craig Wilson" <cwilson@got.net> Newsgroups: borland.public.jbuilder.java.swing Subject: File locking Date: Wed, 15 Oct 2003 10:31:02 -0700 Lines: 15 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 64.125.88.10 Message-ID: <3f8d8436@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1066239030 64.125.88.10 (15 Oct 2003 10:30:30 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed1.easynews.com!easynews.com!easynews!newsfeed.hal-mli.net!feeder2.hal-mli.net!in.100proofnews.com!in.100proofnews.com!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail