You can use CFLock just use the name attribute instead of scope.  Keep in
mind that it will only lock that file within that particular CF Application.

  _____  

From: Jim Campbell [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 29, 2004 3:43 PM
To: CF-Community
Subject: CFTRY CFFILE CFWAYTOOTIRED

I've been up for 18 hours... so I'm definitely sharp today.  We've got
an operation that needs to append to a single CSV.  The request could
come from any one of four load balanced servers to a single netapp filer
system.  The problem is the occasional race condition where the CSV will
be in the process of being written to by one of the CF servers, and the
other one needs to wait its turn like a good CF server, or risk being
sent to bed without its dessert.

I can't use CFLOCK with a file operation can I?  It's easy enough to
CFTRY CFCATCH the file operation, but when it fails, I want it to keep
trying until it gets a chance (within reason, of course - maybe 20 tries
before failing), since it will only be a few milliseconds before its
chance comes up.  I'd like to avoid the ignominious coding mess of
stacking retries in CFCATCH blocks, and there must be a more graceful
way of doing this, but I can't think of it.  Any ideas?

- Jim
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to