RE: 'Locking' a process

2002-10-16 Thread Mike Townend

Wrap it with a named lock ?

HTH



-Original Message-
From: Robertson-Ravo, Neil (REC)
[mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, October 16, 2002 15:16
To: CF-Talk
Subject: 'Locking' a process


Anyone got any ideas on how to do a pseudo lock on a process within an
application? 

My example is that I am reading from an .xml file whose contents can be
edited and then updated.  I want to be able to lock this process so no
other user can overwrite the data while another user is performing the
action on it (or at least flag the fact that its open by another
process.) .

Neil

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm



Re: 'Locking' a process

2002-10-16 Thread Stephen Moretti

You could use a named cflock I believe

Stephen
- Original Message -
From: Robertson-Ravo, Neil (REC) [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Wednesday, October 16, 2002 3:15 PM
Subject: 'Locking' a process


 Anyone got any ideas on how to do a pseudo lock on a process within an
 application?

 My example is that I am reading from an .xml file whose contents can be
 edited and then updated.  I want to be able to lock this process so no
other
 user can overwrite the data while another user is performing the action on
 it (or at least flag the fact that its open by another process.)
 .

 Neil
 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.



Re: 'Locking' a process

2002-10-16 Thread Greg Bullough

How about doing CFLOCK and using a named lock?

Greg

At 03:15 PM 10/16/02 +0100, you wrote:
Anyone got any ideas on how to do a pseudo lock on a process within an
application?

My example is that I am reading from an .xml file whose contents can be
edited and then updated.  I want to be able to lock this process so no other
user can overwrite the data while another user is performing the action on
it (or at least flag the fact that its open by another process.)
.

Neil

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.



RE: 'Locking' a process

2002-10-16 Thread Robertson-Ravo, Neil (REC)

OK, probably didnt make myself clear enough, my mistake...(I am aware of the
cflock)

I obviously want this to happen at the system level, but what I want is an
abstraction above that...i.e. I am editing a file names XXX.xml, I do not
want anyone else to come into the system and edit this file without them
being 'aware' that I have it openedyou see what I mean?

N


-Original Message-
From: Stephen Moretti [mailto:[EMAIL PROTECTED]]
Sent: 16 October 2002 15:30
To: CF-Talk
Subject: Re: 'Locking' a process


You could use a named cflock I believe

Stephen
- Original Message -
From: Robertson-Ravo, Neil (REC) [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Wednesday, October 16, 2002 3:15 PM
Subject: 'Locking' a process


 Anyone got any ideas on how to do a pseudo lock on a process within an
 application?

 My example is that I am reading from an .xml file whose contents can be
 edited and then updated.  I want to be able to lock this process so no
other
 user can overwrite the data while another user is performing the action on
 it (or at least flag the fact that its open by another process.)
 .

 Neil
 

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm



RE: 'Locking' a process

2002-10-16 Thread Everett, Al

Use a semaphore or lock file. When someone grabs addams.xml for editing,
write a really small file called addams.lck to the same directory. When done
processing, delete the addams.lck file. Change the process to look for the
existence of a filename.lck file and if one exists deny access to the
filename.xml file.

You'll need to have a method of clearing old locks, in case someone abandons
the process in the middle. The timestamp on the filename.lck file should
be sufficient. I'd think a lock file over eight hours old ought to be
considered ignorable.

 -Original Message-
 From: Robertson-Ravo, Neil (REC)
 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, October 16, 2002 10:16 AM
 To: CF-Talk
 Subject: 'Locking' a process
 
 
 Anyone got any ideas on how to do a pseudo lock on a process within an
 application? 
 
 My example is that I am reading from an .xml file whose 
 contents can be
 edited and then updated.  I want to be able to lock this 
 process so no other
 user can overwrite the data while another user is performing 
 the action on
 it (or at least flag the fact that its open by another process.)
 .
 
 Neil
 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm



RE: 'Locking' a process

2002-10-16 Thread Rich Wild

sounds like he's got an xml file open for editing though. I think he's
talking about locking it so that noone else can go into the file and edit it
at the same time (ie implementing a client side lock not a server side lock)

I guess you could flick a bit column between 1 and 0. If a user starts
editing the file, hit the db and set the column to 1 (meaning the file is
locked). Everytime someone else hits the page, check the db to see if the
file is locked. If it is, don't allow them to open the file.

Once the first user has finished and saves the changes, flick the bit column
back to 0 to allow others read/write access.

Also, you may want to create some sort of maximum lock time (as users may
start editing a file and never finish, thus locking everyone else out
forever)

To do this, create a timestamp of the current time when a user starts
editing the file and have a scheduled job running on your db to re-unlock
the file after a set period of time etc... Obviously there's a little bit
more thought required to it than that, but you get the idea.

 -Original Message-
 From: Greg Bullough [mailto:[EMAIL PROTECTED]]
 Sent: 16 October 2002 15:29
 To: CF-Talk
 Subject: Re: 'Locking' a process
 
 
 How about doing CFLOCK and using a named lock?
 
 Greg
 
 At 03:15 PM 10/16/02 +0100, you wrote:
 Anyone got any ideas on how to do a pseudo lock on a process 
 within an
 application?
 
 My example is that I am reading from an .xml file whose 
 contents can be
 edited and then updated.  I want to be able to lock this 
 process so no other
 user can overwrite the data while another user is performing 
 the action on
 it (or at least flag the fact that its open by another process.)
 .
 
 Neil
 
 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm



RE: 'Locking' a process

2002-10-16 Thread Robertson-Ravo, Neil (REC)

excellent idea...indeed, superb.  I see what I can knock up; 

-Original Message-
From: Everett, Al [mailto:[EMAIL PROTECTED]]
Sent: 16 October 2002 15:41
To: CF-Talk
Subject: RE: 'Locking' a process


Use a semaphore or lock file. When someone grabs addams.xml for editing,
write a really small file called addams.lck to the same directory. When done
processing, delete the addams.lck file. Change the process to look for the
existence of a filename.lck file and if one exists deny access to the
filename.xml file.

You'll need to have a method of clearing old locks, in case someone abandons
the process in the middle. The timestamp on the filename.lck file should
be sufficient. I'd think a lock file over eight hours old ought to be
considered ignorable.

 -Original Message-
 From: Robertson-Ravo, Neil (REC)
 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, October 16, 2002 10:16 AM
 To: CF-Talk
 Subject: 'Locking' a process
 
 
 Anyone got any ideas on how to do a pseudo lock on a process within an
 application? 
 
 My example is that I am reading from an .xml file whose 
 contents can be
 edited and then updated.  I want to be able to lock this 
 process so no other
 user can overwrite the data while another user is performing 
 the action on
 it (or at least flag the fact that its open by another process.)
 .
 
 Neil
 

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com



Re: 'Locking' a process

2002-10-16 Thread Stephen Moretti

ermm...

Create a .lck file like DW does and check for its existance before
processing.
Have a DB table with a lock flag.

Just a couple that come immediately to mind.

Stephen

- Original Message -
From: Robertson-Ravo, Neil (REC) [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Wednesday, October 16, 2002 3:34 PM
Subject: RE: 'Locking' a process


 OK, probably didnt make myself clear enough, my mistake...(I am aware of
the
 cflock)

 I obviously want this to happen at the system level, but what I want is an
 abstraction above that...i.e. I am editing a file names XXX.xml, I do not
 want anyone else to come into the system and edit this file without them
 being 'aware' that I have it openedyou see what I mean?

 N


 -Original Message-
 From: Stephen Moretti [mailto:[EMAIL PROTECTED]]
 Sent: 16 October 2002 15:30
 To: CF-Talk
 Subject: Re: 'Locking' a process


 You could use a named cflock I believe

 Stephen
 - Original Message -
 From: Robertson-Ravo, Neil (REC) [EMAIL PROTECTED]
 To: CF-Talk [EMAIL PROTECTED]
 Sent: Wednesday, October 16, 2002 3:15 PM
 Subject: 'Locking' a process


  Anyone got any ideas on how to do a pseudo lock on a process within an
  application?
 
  My example is that I am reading from an .xml file whose contents can be
  edited and then updated.  I want to be able to lock this process so no
 other
  user can overwrite the data while another user is performing the action
on
  it (or at least flag the fact that its open by another process.)
  .
 
  Neil
 

 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm



RE: 'Locking' a process

2002-10-16 Thread Robertson-Ravo, Neil (REC)

cheers Rich, I did think of this, but the files has no reference in the DB -
it doesnt need one for this... I think writing a lock file (.lck) is the
way to go :-)



-Original Message-
From: Rich Wild [mailto:[EMAIL PROTECTED]]
Sent: 16 October 2002 15:26
To: CF-Talk
Subject: RE: 'Locking' a process


sounds like he's got an xml file open for editing though. I think he's
talking about locking it so that noone else can go into the file and edit it
at the same time (ie implementing a client side lock not a server side lock)

I guess you could flick a bit column between 1 and 0. If a user starts
editing the file, hit the db and set the column to 1 (meaning the file is
locked). Everytime someone else hits the page, check the db to see if the
file is locked. If it is, don't allow them to open the file.

Once the first user has finished and saves the changes, flick the bit column
back to 0 to allow others read/write access.

Also, you may want to create some sort of maximum lock time (as users may
start editing a file and never finish, thus locking everyone else out
forever)

To do this, create a timestamp of the current time when a user starts
editing the file and have a scheduled job running on your db to re-unlock
the file after a set period of time etc... Obviously there's a little bit
more thought required to it than that, but you get the idea.

 -Original Message-
 From: Greg Bullough [mailto:[EMAIL PROTECTED]]
 Sent: 16 October 2002 15:29
 To: CF-Talk
 Subject: Re: 'Locking' a process
 
 
 How about doing CFLOCK and using a named lock?
 
 Greg
 
 At 03:15 PM 10/16/02 +0100, you wrote:
 Anyone got any ideas on how to do a pseudo lock on a process 
 within an
 application?
 
 My example is that I am reading from an .xml file whose 
 contents can be
 edited and then updated.  I want to be able to lock this 
 process so no other
 user can overwrite the data while another user is performing 
 the action on
 it (or at least flag the fact that its open by another process.)
 .
 
 Neil
 
 

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm



RE: 'Locking' a process

2002-10-16 Thread Rich Wild

hmm, I really like this. Better than my db idea in this instance

nice one.

 -Original Message-
 From: Everett, Al [mailto:[EMAIL PROTECTED]]
 Sent: 16 October 2002 15:41
 To: CF-Talk
 Subject: RE: 'Locking' a process
 
 
 Use a semaphore or lock file. When someone grabs addams.xml 
 for editing,
 write a really small file called addams.lck to the same 
 directory. When done
 processing, delete the addams.lck file. Change the process to 
 look for the
 existence of a filename.lck file and if one exists deny 
 access to the
 filename.xml file.
 
 You'll need to have a method of clearing old locks, in case 
 someone abandons
 the process in the middle. The timestamp on the 
 filename.lck file should
 be sufficient. I'd think a lock file over eight hours old ought to be
 considered ignorable.
 
  -Original Message-
  From: Robertson-Ravo, Neil (REC)
  [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, October 16, 2002 10:16 AM
  To: CF-Talk
  Subject: 'Locking' a process
  
  
  Anyone got any ideas on how to do a pseudo lock on a 
 process within an
  application? 
  
  My example is that I am reading from an .xml file whose 
  contents can be
  edited and then updated.  I want to be able to lock this 
  process so no other
  user can overwrite the data while another user is performing 
  the action on
  it (or at least flag the fact that its open by another process.)
  .
  
  Neil
  
 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm



RE: 'Locking' a process

2002-10-16 Thread Everett, Al

Woo-hoo! I win!

 -Original Message-
 From: Robertson-Ravo, Neil (REC)
 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, October 16, 2002 10:48 AM
 To: CF-Talk
 Subject: RE: 'Locking' a process
 
 
 cheers Rich, I did think of this, but the files has no 
 reference in the DB -
 it doesnt need one for this... I think writing a lock file 
 (.lck) is the
 way to go :-)
 
 
 
 -Original Message-
 From: Rich Wild [mailto:[EMAIL PROTECTED]]
 Sent: 16 October 2002 15:26
 To: CF-Talk
 Subject: RE: 'Locking' a process
 
 
 sounds like he's got an xml file open for editing though. I think he's
 talking about locking it so that noone else can go into the 
 file and edit it
 at the same time (ie implementing a client side lock not a 
 server side lock)
 
 I guess you could flick a bit column between 1 and 0. If a user starts
 editing the file, hit the db and set the column to 1 (meaning 
 the file is
 locked). Everytime someone else hits the page, check the db 
 to see if the
 file is locked. If it is, don't allow them to open the file.
 
 Once the first user has finished and saves the changes, flick 
 the bit column
 back to 0 to allow others read/write access.
 
 Also, you may want to create some sort of maximum lock time 
 (as users may
 start editing a file and never finish, thus locking everyone else out
 forever)
 
 To do this, create a timestamp of the current time when a user starts
 editing the file and have a scheduled job running on your db 
 to re-unlock
 the file after a set period of time etc... Obviously there's 
 a little bit
 more thought required to it than that, but you get the idea.
 
  -Original Message-
  From: Greg Bullough [mailto:[EMAIL PROTECTED]]
  Sent: 16 October 2002 15:29
  To: CF-Talk
  Subject: Re: 'Locking' a process
  
  
  How about doing CFLOCK and using a named lock?
  
  Greg
  
  At 03:15 PM 10/16/02 +0100, you wrote:
  Anyone got any ideas on how to do a pseudo lock on a process 
  within an
  application?
  
  My example is that I am reading from an .xml file whose 
  contents can be
  edited and then updated.  I want to be able to lock this 
  process so no other
  user can overwrite the data while another user is performing 
  the action on
  it (or at least flag the fact that its open by another process.)
  .
  
  Neil
  
  
 
 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm



RE: 'Locking' a process

2002-10-16 Thread Rich Wild

I agree. The lock file idea is more applicable.

 -Original Message-
 From: Robertson-Ravo, Neil (REC)
 [mailto:[EMAIL PROTECTED]]
 Sent: 16 October 2002 15:48
 To: CF-Talk
 Subject: RE: 'Locking' a process
 
 
 cheers Rich, I did think of this, but the files has no 
 reference in the DB -
 it doesnt need one for this... I think writing a lock file 
 (.lck) is the
 way to go :-)
 
 
 
 -Original Message-
 From: Rich Wild [mailto:[EMAIL PROTECTED]]
 Sent: 16 October 2002 15:26
 To: CF-Talk
 Subject: RE: 'Locking' a process
 
 
 sounds like he's got an xml file open for editing though. I think he's
 talking about locking it so that noone else can go into the 
 file and edit it
 at the same time (ie implementing a client side lock not a 
 server side lock)
 
 I guess you could flick a bit column between 1 and 0. If a user starts
 editing the file, hit the db and set the column to 1 (meaning 
 the file is
 locked). Everytime someone else hits the page, check the db 
 to see if the
 file is locked. If it is, don't allow them to open the file.
 
 Once the first user has finished and saves the changes, flick 
 the bit column
 back to 0 to allow others read/write access.
 
 Also, you may want to create some sort of maximum lock time 
 (as users may
 start editing a file and never finish, thus locking everyone else out
 forever)
 
 To do this, create a timestamp of the current time when a user starts
 editing the file and have a scheduled job running on your db 
 to re-unlock
 the file after a set period of time etc... Obviously there's 
 a little bit
 more thought required to it than that, but you get the idea.
 
  -Original Message-
  From: Greg Bullough [mailto:[EMAIL PROTECTED]]
  Sent: 16 October 2002 15:29
  To: CF-Talk
  Subject: Re: 'Locking' a process
  
  
  How about doing CFLOCK and using a named lock?
  
  Greg
  
  At 03:15 PM 10/16/02 +0100, you wrote:
  Anyone got any ideas on how to do a pseudo lock on a process 
  within an
  application?
  
  My example is that I am reading from an .xml file whose 
  contents can be
  edited and then updated.  I want to be able to lock this 
  process so no other
  user can overwrite the data while another user is performing 
  the action on
  it (or at least flag the fact that its open by another process.)
  .
  
  Neil
  
  
 
 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm



RE: 'Locking' a process

2002-10-16 Thread Everett, Al

It harkens back to my days as a BBS SysOp. At the time, multitasking was
just getting into swing on PCs, but most of the third-party applications
(read: games) were strictly single thread. Letting two people into an
application at one time would cause all kinds of havok.

It's also used all over. Access *.ldb files, for instance.

 -Original Message-
 From: Rich Wild [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, October 16, 2002 10:41 AM
 To: CF-Talk
 Subject: RE: 'Locking' a process
 
 
 hmm, I really like this. Better than my db idea in this instance
 
 nice one.
 
  -Original Message-
  From: Everett, Al [mailto:[EMAIL PROTECTED]]
  Sent: 16 October 2002 15:41
  To: CF-Talk
  Subject: RE: 'Locking' a process
  
  
  Use a semaphore or lock file. When someone grabs addams.xml 
  for editing,
  write a really small file called addams.lck to the same 
  directory. When done
  processing, delete the addams.lck file. Change the process to 
  look for the
  existence of a filename.lck file and if one exists deny 
  access to the
  filename.xml file.
  
  You'll need to have a method of clearing old locks, in case 
  someone abandons
  the process in the middle. The timestamp on the 
  filename.lck file should
  be sufficient. I'd think a lock file over eight hours old 
 ought to be
  considered ignorable.
  
   -Original Message-
   From: Robertson-Ravo, Neil (REC)
   [mailto:[EMAIL PROTECTED]]
   Sent: Wednesday, October 16, 2002 10:16 AM
   To: CF-Talk
   Subject: 'Locking' a process
   
   
   Anyone got any ideas on how to do a pseudo lock on a 
  process within an
   application? 
   
   My example is that I am reading from an .xml file whose 
   contents can be
   edited and then updated.  I want to be able to lock this 
   process so no other
   user can overwrite the data while another user is performing 
   the action on
   it (or at least flag the fact that its open by another process.)
   .
   
   Neil
   
  
 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.



Re: 'Locking' a process

2002-10-16 Thread S . Isaac Dealey

 Anyone got any ideas on how to do a pseudo lock on a process within an
 application?

 My example is that I am reading from an .xml file whose contents can be
 edited and then updated.  I want to be able to lock this process so no
 other
 user can overwrite the data while another user is performing the action on
 it (or at least flag the fact that its open by another process.)

Tapestry does this with all the content records -- they're flagged in the db
as in use by user [x] with privelegdes [RWED] -- if another user has a
record open with more than R privilege, other users get only R privilege,
regardless of their role or permissions, until the first user closes the
record.

Let me know if you'd like a more thorough explanation of how it's
accomplished.


S. Isaac Dealey
Certified Advanced ColdFusion 5 Developer

www.turnkey.to
954-776-0046
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com



RE: 'Locking' a process

2002-10-16 Thread S . Isaac Dealey

Problem with a named lock is it's only available for the short time that a
single cfmodule is accessing that file -- I _think_ he's talking about
something more like a source-control check-in/check-out idea.

 Wrap it with a named lock ?

 HTH



 -Original Message-
 From: Robertson-Ravo, Neil (REC)
 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, October 16, 2002 15:16
 To: CF-Talk
 Subject: 'Locking' a process


 Anyone got any ideas on how to do a pseudo lock on a process within an
 application?

 My example is that I am reading from an .xml file whose contents can be
 edited and then updated.  I want to be able to lock this process so no
 other user can overwrite the data while another user is performing the
 action on it (or at least flag the fact that its open by another
 process.) .

 Neil

 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm



RE: 'Locking' a process

2002-10-16 Thread Robertson-Ravo, Neil (REC)

yep, but I am not using a DB on this one, and how does it react if someone
doesnt go thru the actual process hence the timestamp check thingy?

-Original Message-
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]]
Sent: 16 October 2002 16:31
To: CF-Talk
Subject: Re: 'Locking' a process


 Anyone got any ideas on how to do a pseudo lock on a process within an
 application?

 My example is that I am reading from an .xml file whose contents can be
 edited and then updated.  I want to be able to lock this process so no
 other
 user can overwrite the data while another user is performing the action on
 it (or at least flag the fact that its open by another process.)

Tapestry does this with all the content records -- they're flagged in the db
as in use by user [x] with privelegdes [RWED] -- if another user has a
record open with more than R privilege, other users get only R privilege,
regardless of their role or permissions, until the first user closes the
record.

Let me know if you'd like a more thorough explanation of how it's
accomplished.


S. Isaac Dealey
Certified Advanced ColdFusion 5 Developer

www.turnkey.to
954-776-0046

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.



RE: 'Locking' a process

2002-10-16 Thread Robertson-Ravo, Neil (REC)

yep, I think we have established that :-p

LOL

-Original Message-
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]]
Sent: 16 October 2002 16:33
To: CF-Talk
Subject: RE: 'Locking' a process


Problem with a named lock is it's only available for the short time that a
single cfmodule is accessing that file -- I _think_ he's talking about
something more like a source-control check-in/check-out idea.

 Wrap it with a named lock ?

 HTH



 -Original Message-
 From: Robertson-Ravo, Neil (REC)
 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, October 16, 2002 15:16
 To: CF-Talk
 Subject: 'Locking' a process


 Anyone got any ideas on how to do a pseudo lock on a process within an
 application?

 My example is that I am reading from an .xml file whose contents can be
 edited and then updated.  I want to be able to lock this process so no
 other user can overwrite the data while another user is performing the
 action on it (or at least flag the fact that its open by another
 process.) .

 Neil

 

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm



RE: 'Locking' a process

2002-10-16 Thread S . Isaac Dealey

 -Original Message-
 From: Everett, Al [mailto:[EMAIL PROTECTED]]
 Sent: 16 October 2002 15:41
 To: CF-Talk
 Subject: RE: 'Locking' a process


 Use a semaphore or lock file. When someone grabs addams.xml
 for editing,
 write a really small file called addams.lck to the same
 directory. When done
 processing, delete the addams.lck file. Change the process to
 look for the
 existence of a filename.lck file and if one exists deny
 access to the
 filename.xml file.

The .lck file can actually be an xml file of it's own -- wddx should be
sufficient -- containing the name and possibly some contact information for
the individual who currently has the file locked. If you also include the
time in your wddx packet this also prevents you having to perform a separate
cfdirectory ( or windows filesystemobject scripting ) to get the time of
the file -- unless you check for the existance of the .lck file with
cfdirectory in which case, you could potentially get the time and a
name/email address from just the cfdirectory call...


S. Isaac Dealey
Certified Advanced ColdFusion 5 Developer

www.turnkey.to
954-776-0046
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm



RE: 'Locking' a process

2002-10-16 Thread Thomas Chiverton

 how does it react if someone
 doesnt go thru the actual process hence the timestamp check
 thingy?

The trouble with most application lock files, is that if you don't use the
application, you can override the lock anyway.
With access, you can just delete the .ldb file.
With dreamweaver's .lck files, you can just log onto the server and edit the
files directly anyway.

I don't know of anyway of calling the O/S flock()

Tom Chiverton
You don't have to be a mad scientist to believe in ColdFusion




~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm



RE: 'Locking' a process

2002-10-16 Thread S . Isaac Dealey

you mean abandoning the session? ... Yea, Tapestry has a fairly hefty
login-logout architecture, which theoretically prevents people from
abandoning content -- it's still possible to do it, but you'd have to work
pretty hard at it. If you did manage it, unlocking the record wouldn't be
tremendously difficult.

Under normal conditions any content you have open gets closed automagically
when you log out or are automagically logged out by the application ( which
happens after [x] idle time if keep alive isn't turned on for your session,
or if you close the browser or type in a different url ).

Most applications probably won't have this luxury, so you're probably right,
the file-system solution is probably more appropriate in this instance,
especially since you're wanting to lock access to a file and not to a
database record as Tapestry does.

S. Isaac Dealey
Certified Advanced ColdFusion 5 Developer

www.turnkey.to
954-776-0046

 yep, but I am not using a DB on this one, and how does it react if someone
 doesnt go thru the actual process hence the timestamp check thingy?

 -Original Message-
 From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]]
 Sent: 16 October 2002 16:31
 To: CF-Talk
 Subject: Re: 'Locking' a process


 Anyone got any ideas on how to do a pseudo lock on a process within an
 application?

 My example is that I am reading from an .xml file whose contents can be
 edited and then updated.  I want to be able to lock this process so no
 other
 user can overwrite the data while another user is performing the action
 on
 it (or at least flag the fact that its open by another process.)

 Tapestry does this with all the content records -- they're flagged in the
 db
 as in use by user [x] with privelegdes [RWED] -- if another user has a
 record open with more than R privilege, other users get only R privilege,
 regardless of their role or permissions, until the first user closes the
 record.

 Let me know if you'd like a more thorough explanation of how it's
 accomplished.


 S. Isaac Dealey
 Certified Advanced ColdFusion 5 Developer

 www.turnkey.to
 954-776-0046

 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm



RE: 'Locking' a process

2002-10-16 Thread S . Isaac Dealey

serves me right for responding before I finish reading the previous posts.
:)

 yep, I think we have established that :-p

 LOL

 -Original Message-
 From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]]
 Sent: 16 October 2002 16:33
 To: CF-Talk
 Subject: RE: 'Locking' a process


 Problem with a named lock is it's only available for the short time that a
 single cfmodule is accessing that file -- I _think_ he's talking about
 something more like a source-control check-in/check-out idea.

 Wrap it with a named lock ?

 HTH



 -Original Message-
 From: Robertson-Ravo, Neil (REC)
 [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, October 16, 2002 15:16
 To: CF-Talk
 Subject: 'Locking' a process


 Anyone got any ideas on how to do a pseudo lock on a process within an
 application?

 My example is that I am reading from an .xml file whose contents can be
 edited and then updated.  I want to be able to lock this process so no
 other user can overwrite the data while another user is performing the
 action on it (or at least flag the fact that its open by another
 process.) .

 Neil



 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.



RE: 'Locking' a process

2002-10-16 Thread S . Isaac Dealey

I think there are ways to set readonly on a file using cffile or the
windows scripting host, but my impression is that in most cases these sorts
of operations aren't concerned with absolutely preventing people from
maliciously circumventing the system ( as is the case with anti-virus and
firewall software ) but rather to stop and notify most reasonable / normal
users who are using the system as expected under reasonably normal
circumstances.

 how does it react if someone
 doesnt go thru the actual process hence the timestamp check
 thingy?

 The trouble with most application lock files, is that if you don't use the
 application, you can override the lock anyway.
 With access, you can just delete the .ldb file.
 With dreamweaver's .lck files, you can just log onto the server and edit
 the
 files directly anyway.

 I don't know of anyway of calling the O/S flock()

 Tom Chiverton
 You don't have to be a mad scientist to believe in ColdFusion




 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm