The SOAP Challenge - SalesForce.com says that CFMX can't do it!

Ok guys here is the deal. I am trying to integrate a ColdFusion backend with
the SalesForce.com 2.5 API. They do not support CF because they say that it
can not consume advanced SOAP web services correctly. 

You can read more about the SF API at http://www.sforce.com. I think that it
is possible to do it with CFMX 6.1 as long as the reccomended hotfix is
installed.
(http://www.macromedia.com/support/coldfusion/ts/documents/webservices_heade
r.htm) 

The deal is I can not get it to work. The problem is that it seems our
ability to set soap headers is limited. The proper SOAP request format is:

<!-- START SOAP REQUEST -->
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.1
Host: aspen.salesforce.com
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 717

<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/
XMLSchema-instance">
<soapenv:Header>
<ns1:SessionHeader soapenv:mustUnderstand="0" xmlns:ns1="SoapService">
<ns2:sessionId
xmlns:ns2="urn:enterprise.soap.sforce.com">_ZnWl8zuUbtuhBXlNKOSU</ns2:sessio
nId>
</ns1:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<getUserInfo xmlns="urn:enterprise.soap.sforce.com">
<getUserInfo xsi:type="xsd:string">[EMAIL PROTECTED]</getUserInfo>
</getUserInfo>
</soapenv:Body>
</soapenv:Envelope>

<!-- END SOAP REQUEST -->


I can login and get a valid login buy using this code:

<!--- Create web service and login: --->
<cfscript>
sfapi = CreateObject("webservice", "#WSDLURL#");
loginResult = sfapi.login("#userName#", "#password#");
</cfscript>

But when I try to access a method in the web service by:

<cfscript>
ws = CreateObject("webservice", '#WSDLURL2#');
addRequestHeader(ws, "sessionID", '#loginResult.sessionID#',
"urn:enterprise.soap.sforce.com");
getUserInfoResponse = ws.getUserInfo("[EMAIL PROTECTED]");
</cfscript>

I continually get errors that header values are not being set. 

The error is:

Could not perform web service invocation "getUserInfo" because AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server faultSubcode:
faultString: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader
faultActor: faultNode: faultDetail:
{urn:fault.enterprise.soap.sforce.com}fault:
<sf:exceptionCode>INVALID_SESSION_ID</sf:exceptionCode>
<sf:exceptionMessage>Invalid Session ID found in
SessionHeader</sf:exceptionMessage> 


So the question is this: <b>IS IT POSSIBLE TO CONSUME SOAP WEB SERVICES
????</b> Salesforce has done it with PHP, C# , Java, VB.Net., and even
Pearl.

I am sure that it is a stupid error on my part but I sure don't see it. 


 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 25, 2004 7:20 AM
Subject: [PERIODIC cfcdev DIGEST POSTING]


From: Justin Balog <[EMAIL PROTECTED]>
Date: Tue, 24 Feb 2004 09:01:32 -0700
Subject: RE: [CFCDev] [Kind of OT]: Record Locking and Avoiding Race Condi
Reply-To: [EMAIL PROTECTED]
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

----=_NextPart_ST_09_15_01_Tuesday_February_24_2004_29958
Content-Type: text/plain;
        charset="iso-8859-1"

I like the idea of user negotiated locking =)  Does your application suffer
any performance hits due to the nature of the locking in the lock manager?
 
Thanks,
 
Justin

-----Original Message-----
From: Mark Porter [mailto:[EMAIL PROTECTED]
Sent: Monday, February 23, 2004 10:39 AM
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] [Kind of OT]: Record Locking and Avoiding Race
Conditions?


We come accross this quite a bit. The system we use is to create an
application structure that is keyed off the id of the object being edited.
When a user (Joe) obtains a lock, his or her userid and a timestamp is added
to the structure. If another user(Mary) attempts to get a lock they are
given a message similar to this: "This object was locked for editng by Joe
Schmoe on 02/20/2004 at 10:00. Click UNLOCK to edit this record. THIS MAY
DISCARD CHANGES MADE BY JOE SCHMOE." Clicking unlock replaces Joe's lock
with Mary's. If Joe tries to save, he will see the message: "Your changes
were not saved because your edit lock was removed by Mary Tidings on
02/20/2004 at 10:01" We make our users talk to each other to negotiate
locks, and offer the force option for when computers crash or people open a
record and go to lunch. 

>>>[EMAIL PROTECTED] 02/20 1:45 pm >>>

Howdy,

I am working on an intranet type solution, and am running into data
integrity and record locking concerns. 

The classic problem I want to solve is preventing one person from writing
over the same record in an update that is being performed on the same record
as another person. 

1) User #1 loads record detail and begins to edit it.
2) User #2 loads same record detail and begins to edit it.
3) User #1 saves record to dB.
4) User #2 saves record to dB and overwrites #1's changes.

I know everyone runs into this when dealing with shared record sets, so any
thoughts on how others have solved this problem? 

Here is my thought on the matter.

1) User #1 loads record detail and begins to edit it.
   When record is loaded, an obj is instantiated with that records
instance data and added into a statefull lock manager.  (This is locked to
avoid race conditions)
2) User #2 loads same record detail and begins to edit it.
   Lock manager checks to see if that obj. already exists in it, which
it does, so it does not load a new one, but does increment the count of the
number of people who     have that record open.
3) User #1 saves record to dB.
   After save, the instance data of the obj in the lock manager is
updated with the saved data, and the count of individuals with the record
open is deincremented.
4) User #2 saves record to dB and overwrites #1's changes.
   --Attempt to save, the instance data of the object to be saved is
compared to the instance data of the object in the lock manager.  If the
data is different, a message is     returned asking whether or not they
would like to overwrite the new data. 
      --If yes, then the record is saved, and the obj open count
in the lock manager is deincremented.
         --If the open count is 0, then the object is deleted
from the lock manager
         --Else, the object in the lock manager is updated
with the newly saved instance data.

I think there are a couple problems with this:
   1) Memory consumption.  I think my having to load in all these obj
in the lock manager, you could potentially crash the server ---need some way
to control the     amount of objects in the lock manager.
   2) User leaves open record with out committing to the save so the
open obj count in the lock manager would never be deincremented.
   3) I know there are going to be problems relating to RACE
conditions....so point them out!!!!

Any thoughts, feel free to throw this idea up as you say 'PULL' and shoot it
down =)  I am just starting to figure this out?

Thanks again,

Justin




----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]



----=_NextPart_ST_09_15_01_Tuesday_February_24_2004_29958
Content-Type: text/html;
        charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2800.1170" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px">
<DIV><SPAN class=526571016-24022004><FONT face=Arial color=#0000ff size=2>I
like 
the idea of user negotiated locking =)&nbsp; Does your application suffer
any 
performance hits due to the nature of the locking in the lock 
manager?</FONT></SPAN></DIV>
<DIV><SPAN class=526571016-24022004><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=526571016-24022004><FONT face=Arial color=#0000ff 
size=2>Thanks,</FONT></SPAN></DIV>
<DIV><SPAN class=526571016-24022004><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=526571016-24022004><FONT face=Arial color=#0000ff 
size=2>Justin</FONT></SPAN></DIV>
<BLOCKQUOTE>
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> Mark Porter 
  [mailto:[EMAIL PROTECTED]<BR><B>Sent:</B> Monday, February 23, 2004
10:39 
  AM<BR><B>To:</B> [EMAIL PROTECTED]<BR><B>Subject:</B> Re: [CFCDev] [Kind
of 
  OT]: Record Locking and Avoiding Race Conditions?<BR><BR></FONT></DIV>We
come 
  accross this quite a bit. The system we use is to create an application 
  structure that is keyed off the id of the object being edited. When a user

  (Joe) obtains a lock, his or her userid and a timestamp is added to the 
  structure. If another user(Mary) attempts to get a lock they are given a 
  message similar to this: "This object was locked for editng by Joe Schmoe
on 
  02/20/2004 at 10:00. Click UNLOCK to edit this record. THIS MAY DISCARD 
  CHANGES MADE BY JOE SCHMOE." Clicking unlock replaces Joe's lock with
Mary's. 
  If Joe tries to save, he will see the message: "Your changes were not
saved 
  because your edit lock was removed by Mary Tidings on 02/20/2004 at 10:01"
We 
  make our users talk to each other to negotiate locks, and offer the force 
  option for when computers crash or people open a record and go to lunch. 
  <BR><BR>&gt;&gt;&gt;[EMAIL PROTECTED] 02/20 1:45 pm 
  &gt;&gt;&gt;<BR><BR>Howdy,<BR><BR>I am working on an intranet type
solution, 
  and am running into data<BR>integrity and record locking 
  concerns.&nbsp;<BR><BR>The classic problem I want to solve is preventing
one 
  person from writing<BR>over the same record in an update that is being 
  performed on the same record<BR>as another person.&nbsp;<BR><BR>1) User #1

  loads record detail and begins to edit it.<BR>2) User #2 loads same record

  detail and begins to edit it.<BR>3) User #1 saves record to dB.<BR>4) User
#2 
  saves record to dB and overwrites #1's changes.<BR><BR>I know everyone
runs 
  into this when dealing with shared record sets, so any<BR>thoughts on how 
  others have solved this problem?&nbsp;<BR><BR>Here is my thought on the 
  matter.<BR><BR>1) User #1 loads record detail and begins to edit 
  it.<BR>&nbsp;&nbsp;&nbsp;When record is loaded, an obj is instantiated
with 
  that records<BR>instance data and added into a statefull lock
manager.&nbsp; 
  (This is locked to<BR>avoid race conditions)<BR>2) User #2 loads same
record 
  detail and begins to edit it.<BR>&nbsp;&nbsp;&nbsp;Lock manager checks to
see 
  if that obj. already exists in it, which<BR>it does, so it does not load a
new 
  one, but does increment the count of the<BR>number of people who 
  &nbsp;&nbsp;&nbsp; have that record open.<BR>3) User #1 saves record to 
  dB.<BR>&nbsp;&nbsp;&nbsp;After save, the instance data of the obj in the
lock 
  manager is<BR>updated with the saved data, and the count of individuals
with 
  the record<BR>open is deincremented.<BR>4) User #2 saves record to dB and 
  overwrites #1's changes.<BR>&nbsp;&nbsp;&nbsp;--Attempt to save, the
instance 
  data of the object to be saved is<BR>compared to the instance data of the 
  object in the lock manager.&nbsp; If the<BR>data is different, a message
is 
  &nbsp;&nbsp;&nbsp; returned asking whether or not they<BR>would like to 
  overwrite the new data.&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--If
yes, 
  then the record is saved, and the obj open count<BR>in the lock manager is

 
deincremented.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--If

  the open count is 0, then the object is deleted<BR>from the lock 
  manager<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--Else,
the 
  object in the lock manager is updated<BR>with the newly saved instance 
  data.<BR><BR>I think there are a couple problems with 
  this:<BR>&nbsp;&nbsp;&nbsp;1) Memory consumption.&nbsp; I think my having
to 
  load in all these obj<BR>in the lock manager, you could potentially crash
the 
  server ---need some way<BR>to control the &nbsp;&nbsp;&nbsp; amount of
objects 
  in the lock manager.<BR>&nbsp;&nbsp;&nbsp;2) User leaves open record with
out 
  committing to the save so the<BR>open obj count in the lock manager would 
  never be deincremented.<BR>&nbsp;&nbsp;&nbsp;3) I know there are going to
be 
  problems relating to RACE<BR>conditions....so point them
out!!!!<BR><BR>Any 
  thoughts, feel free to throw this idea up as you say 'PULL' and shoot 
  it<BR>down =)&nbsp; I am just starting to figure this out?<BR><BR>Thanks 
 
again,<BR><BR>Justin<BR><BR><BR><BR><BR>------------------------------------
----------------------<BR>You 
  are subscribed to cfcdev. To unsubscribe, send an email<BR>to 
  [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'<BR>in the message
of 
  the email.<BR><BR>CFCDev is run by CFCZone (www.cfczone.org) and 
  supported<BR>by Mindtool, Corporation (www.mindtool.com).<BR><BR>An
archive of 
  the CFCDev list is available at 
www.mail-archive.com/[EMAIL PROTECTED]<BR></BLOCKQUOTE></BODY></HTML>

----=_NextPart_ST_09_15_01_Tuesday_February_24_2004_29958--


From: "Roland Collins" <[EMAIL PROTECTED]>
Subject: RE: [CFCDev] [Kind of OT]: Record Locking and Avoiding Race Condi
tions?
Date: Tue, 24 Feb 2004 11:53:07 -0500
Reply-To: [EMAIL PROTECTED]
This is a multi-part message in MIME format.

------=_NextPart_000_0032_01C3FACC.C4A50F90
Content-Type: text/plain;
        charset="us-ascii"
Content-Transfer-Encoding: 7bit

IMO, you're asking for trouble if you have to get users talking to resolve
locking conflicts.  Irregardless of the programmatic bottleneck, you're now
introducing a "physical world" bottleneck.  And how do you think Mary feels
after finally clicking "submit", only to be told "Sorry - you've been
hijacked"?  You're essentially saying that whoever clicks "submit" first has
the most important data!

 

  _____  

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Justin Balog
Sent: Tuesday, February 24, 2004 11:02 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [CFCDev] [Kind of OT]: Record Locking and Avoiding Race Condi
tions?

 

I like the idea of user negotiated locking =)  Does your application suffer
any performance hits due to the nature of the locking in the lock manager?

 

Thanks,

 

Justin

-----Original Message-----
From: Mark Porter [mailto:[EMAIL PROTECTED]
Sent: Monday, February 23, 2004 10:39 AM
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] [Kind of OT]: Record Locking and Avoiding Race
Conditions?

We come accross this quite a bit. The system we use is to create an
application structure that is keyed off the id of the object being edited.
When a user (Joe) obtains a lock, his or her userid and a timestamp is added
to the structure. If another user(Mary) attempts to get a lock they are
given a message similar to this: "This object was locked for editng by Joe
Schmoe on 02/20/2004 at 10:00. Click UNLOCK to edit this record. THIS MAY
DISCARD CHANGES MADE BY JOE SCHMOE." Clicking unlock replaces Joe's lock
with Mary's. If Joe tries to save, he will see the message: "Your changes
were not saved because your edit lock was removed by Mary Tidings on
02/20/2004 at 10:01" We make our users talk to each other to negotiate
locks, and offer the force option for when computers crash or people open a
record and go to lunch. 

>>>[EMAIL PROTECTED] 02/20 1:45 pm >>>

Howdy,

I am working on an intranet type solution, and am running into data
integrity and record locking concerns. 

The classic problem I want to solve is preventing one person from writing
over the same record in an update that is being performed on the same record
as another person. 

1) User #1 loads record detail and begins to edit it.
2) User #2 loads same record detail and begins to edit it.
3) User #1 saves record to dB.
4) User #2 saves record to dB and overwrites #1's changes.

I know everyone runs into this when dealing with shared record sets, so any
thoughts on how others have solved this problem? 

Here is my thought on the matter.

1) User #1 loads record detail and begins to edit it.
   When record is loaded, an obj is instantiated with that records
instance data and added into a statefull lock manager.  (This is locked to
avoid race conditions)
2) User #2 loads same record detail and begins to edit it.
   Lock manager checks to see if that obj. already exists in it, which
it does, so it does not load a new one, but does increment the count of the
number of people who     have that record open.
3) User #1 saves record to dB.
   After save, the instance data of the obj in the lock manager is
updated with the saved data, and the count of individuals with the record
open is deincremented.
4) User #2 saves record to dB and overwrites #1's changes.
   --Attempt to save, the instance data of the object to be saved is
compared to the instance data of the object in the lock manager.  If the
data is different, a message is     returned asking whether or not they
would like to overwrite the new data. 
      --If yes, then the record is saved, and the obj open count
in the lock manager is deincremented.
         --If the open count is 0, then the object is deleted
from the lock manager
         --Else, the object in the lock manager is updated
with the newly saved instance data.

I think there are a couple problems with this:
   1) Memory consumption.  I think my having to load in all these obj
in the lock manager, you could potentially crash the server ---need some way
to control the     amount of objects in the lock manager.
   2) User leaves open record with out committing to the save so the
open obj count in the lock manager would never be deincremented.
   3) I know there are going to be problems relating to RACE
conditions....so point them out!!!!

Any thoughts, feel free to throw this idea up as you say 'PULL' and shoot it
down =)  I am just starting to figure this out?

Thanks again,

Justin




----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]


------=_NextPart_000_0032_01C3FACC.C4A50F90
Content-Type: text/html;
        charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html>

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered)">

<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin-right:0in;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-believe-normal-left:yes;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<![if mso 9]>
<style>
p.MsoNormal
        {margin-left:3.0pt;}
</style>
<![endif]>
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple =
style=3D'margin-left:3.0pt;margin-top:
3.0pt;margin-right:3.0pt;margin-bottom:.75pt'>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>IMO, you&#8217;re asking for =
trouble if
you have to get users talking to resolve locking conflicts.&nbsp; =
Irregardless
of the programmatic bottleneck, you&#8217;re now introducing a =
&#8220;physical
world&#8221; bottleneck.&nbsp; And how do you think Mary feels after =
finally clicking
&#8220;submit&#8221;, only to be told &#8220;Sorry - you&#8217;ve been =
hijacked&#8221;?&nbsp;
You&#8217;re essentially saying that whoever clicks &#8220;submit&#8221; =
first
has the most important data!</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font =
size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>

<hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1>

</span></font></div>

<div>

<p class=3DMsoNormal style=3D'margin:0in;margin-bottom:.0001pt'><b><font =
size=3D2
face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</spa=
n></font></b><font
size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'>
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] <b><span
style=3D'font-weight:bold'>On Behalf Of </span></b>Justin Balog<br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Tuesday, February =
24, 2004
11:02 AM<br>
<b><span style=3D'font-weight:bold'>To:</span></b> =
'[EMAIL PROTECTED]'<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> RE: [CFCDev] =
[Kind of
OT]: Record Locking and Avoiding Race Condi tions?</span></font></p>

</div>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'>&nbsp;</span></font></p>

<div>

<p class=3DMsoNormal style=3D'margin:0in;margin-bottom:.0001pt'><font =
size=3D2
color=3Dblue face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial;
color:blue'>I like the idea of user negotiated locking =3D)&nbsp; Does =
your
application suffer any performance hits due to the nature of the locking =
in the
lock manager?</span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin:0in;margin-bottom:.0001pt'><font =
size=3D3
face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin:0in;margin-bottom:.0001pt'><font =
size=3D2
color=3Dblue face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial;
color:blue'>Thanks,</span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin:0in;margin-bottom:.0001pt'><font =
size=3D3
face=3D"Times New Roman"><span =
style=3D'font-size:12.0pt'>&nbsp;</span></font></p>

</div>

<div>

<p class=3DMsoNormal style=3D'margin:0in;margin-bottom:.0001pt'><font =
size=3D2
color=3Dblue face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial;
color:blue'>Justin</span></font></p>

</div>

<blockquote style=3D'margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=3DMsoNormal =
style=3D'margin-right:0in;margin-bottom:12.0pt;margin-left:
0in'><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original
Message-----<br>
<b><span style=3D'font-weight:bold'>From:</span></b> Mark Porter
[mailto:[EMAIL PROTECTED]<br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Monday, February =
23, 2004
10:39 AM<br>
<b><span style=3D'font-weight:bold'>To:</span></b> =
[EMAIL PROTECTED]<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> Re: [CFCDev] =
[Kind of
OT]: Record Locking and Avoiding Race Conditions?</span></font></p>

<p class=3DMsoNormal style=3D'margin:0in;margin-bottom:.0001pt'><font =
size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>We come =
accross this
quite a bit. The system we use is to create an application structure =
that is
keyed off the id of the object being edited. When a user (Joe) obtains a =
lock,
his or her userid and a timestamp is added to the structure. If another
user(Mary) attempts to get a lock they are given a message similar to =
this:
&quot;This object was locked for editng by Joe Schmoe on 02/20/2004 at =
10:00.
Click UNLOCK to edit this record. THIS MAY DISCARD CHANGES MADE BY JOE
SCHMOE.&quot; Clicking unlock replaces Joe's lock with Mary's. If Joe =
tries to
save, he will see the message: &quot;Your changes were not saved because =
your
edit lock was removed by Mary Tidings on 02/20/2004 at 10:01&quot; We =
make our
users talk to each other to negotiate locks, and offer the force option =
for
when computers crash or people open a record and go to lunch. <br>
<br>
&gt;&gt;&gt;[EMAIL PROTECTED] 02/20 1:45 pm &gt;&gt;&gt;<br>
<br>
Howdy,<br>
<br>
I am working on an intranet type solution, and am running into data<br>
integrity and record locking concerns.&nbsp;<br>
<br>
The classic problem I want to solve is preventing one person from =
writing<br>
over the same record in an update that is being performed on the same =
record<br>
as another person.&nbsp;<br>
<br>
1) User #1 loads record detail and begins to edit it.<br>
2) User #2 loads same record detail and begins to edit it.<br>
3) User #1 saves record to dB.<br>
4) User #2 saves record to dB and overwrites #1's changes.<br>
<br>
I know everyone runs into this when dealing with shared record sets, so =
any<br>
thoughts on how others have solved this problem?&nbsp;<br>
<br>
Here is my thought on the matter.<br>
<br>
1) User #1 loads record detail and begins to edit it.<br>
&nbsp;&nbsp;&nbsp;When record is loaded, an obj is instantiated with =
that
records<br>
instance data and added into a statefull lock manager.&nbsp; (This is =
locked to<br>
avoid race conditions)<br>
2) User #2 loads same record detail and begins to edit it.<br>
&nbsp;&nbsp;&nbsp;Lock manager checks to see if that obj. already exists =
in it,
which<br>
it does, so it does not load a new one, but does increment the count of =
the<br>
number of people who &nbsp;&nbsp;&nbsp; have that record open.<br>
3) User #1 saves record to dB.<br>
&nbsp;&nbsp;&nbsp;After save, the instance data of the obj in the lock =
manager
is<br>
updated with the saved data, and the count of individuals with the =
record<br>
open is deincremented.<br>
4) User #2 saves record to dB and overwrites #1's changes.<br>
&nbsp;&nbsp;&nbsp;--Attempt to save, the instance data of the object to =
be
saved is<br>
compared to the instance data of the object in the lock manager.&nbsp; =
If the<br>
data is different, a message is &nbsp;&nbsp;&nbsp; returned asking =
whether or
not they<br>
would like to overwrite the new data.&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--If yes, then the record is saved, =
and the
obj open count<br>
in the lock manager is deincremented.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--If the open =
count is 0,
then the object is deleted<br>
from the lock manager<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--Else, the object =
in the
lock manager is updated<br>
with the newly saved instance data.<br>
<br>
I think there are a couple problems with this:<br>
&nbsp;&nbsp;&nbsp;1) Memory consumption.&nbsp; I think my having to load =
in all
these obj<br>
in the lock manager, you could potentially crash the server ---need some =
way<br>
to control the &nbsp;&nbsp;&nbsp; amount of objects in the lock =
manager.<br>
&nbsp;&nbsp;&nbsp;2) User leaves open record with out committing to the =
save so
the<br>
open obj count in the lock manager would never be deincremented.<br>
&nbsp;&nbsp;&nbsp;3) I know there are going to be problems relating to =
RACE<br>
conditions....so point them out!!!!<br>
<br>
Any thoughts, feel free to throw this idea up as you say 'PULL' and =
shoot it<br>
down =3D)&nbsp; I am just starting to figure this out?<br>
<br>
Thanks again,<br>
<br>
Justin<br>
<br>
<br>
<br>
<br>
----------------------------------------------------------<br>
You are subscribed to cfcdev. To unsubscribe, send an email<br>
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'<br>
in the message of the email.<br>
<br>
CFCDev is run by CFCZone (www.cfczone.org) and supported<br>
by Mindtool, Corporation (www.mindtool.com).<br>
<br>
An archive of the CFCDev list is available at =
www.mail-archive.com/[EMAIL PROTECTED]</span></font></p>

</blockquote>

</div>

</body>

</html>

------=_NextPart_000_0032_01C3FACC.C4A50F90--



Subject: RE: [CFCDev] [Kind of OT]: Record Locking and Avoiding Race Condi
tions?
Date: Tue, 24 Feb 2004 18:56:39 +0100
From: "Hugo Ahlenius" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
For such a scenario, I think it would be much better to have the lock at
the "checkout" time. I'd hate to write up something, and then be told
that I can't submit it... (even if I talk to someone about it, we would
have the problem of merging our changes)




-------------------------------------------------------------
Hugo Ahlenius                  E-Mail: [EMAIL PROTECTED]
Project Officer                Phone:            +46 8 230460
UNEP GRID-Arendal              Fax:              +46 8 230441
Stockholm Office               Mobile:         +46 733 467111
                               WWW:       http://www.grida.no
------------------------------------------------------------- 






| -----Original Message-----
| From: Roland Collins [mailto:[EMAIL PROTECTED]
| Sent: Tuesday, February 24, 2004 17:53
| To: [EMAIL PROTECTED]
| Subject: RE: [CFCDev] [Kind of OT]: Record Locking and
| Avoiding Race Condi tions?
|
| IMO, you're asking for trouble if you have to get users
| talking to resolve locking conflicts.  Irregardless of the
| programmatic bottleneck, you're now introducing a "physical
| world" bottleneck.  And how do you think Mary feels after
| finally clicking "submit", only to be told "Sorry - you've
| been hijacked"?  You're essentially saying that whoever
| clicks "submit" first has the most important data!
|
|
|
| ________________________________
|
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED] On Behalf Of Justin Balog
| Sent: Tuesday, February 24, 2004 11:02 AM
| To: '[EMAIL PROTECTED]'
| Subject: RE: [CFCDev] [Kind of OT]: Record Locking and
| Avoiding Race Condi tions?
|
|
|
| I like the idea of user negotiated locking =)  Does your
| application suffer any performance hits due to the nature of
| the locking in the lock manager?
|
|
|
| Thanks,
|
|
|
| Justin
|
|       -----Original Message-----
|       From: Mark Porter [mailto:[EMAIL PROTECTED]
|       Sent: Monday, February 23, 2004 10:39 AM
|       To: [EMAIL PROTECTED]
|       Subject: Re: [CFCDev] [Kind of OT]: Record Locking and
| Avoiding Race Conditions?
|
|       We come accross this quite a bit. The system we use is
| to create an application structure that is keyed off the id
| of the object being edited. When a user (Joe) obtains a lock,
| his or her userid and a timestamp is added to the structure.
| If another user(Mary) attempts to get a lock they are given a
| message similar to this: "This object was locked for editng
| by Joe Schmoe on 02/20/2004 at 10:00. Click UNLOCK to edit
| this record. THIS MAY DISCARD CHANGES MADE BY JOE SCHMOE."
| Clicking unlock replaces Joe's lock with Mary's. If Joe tries
| to save, he will see the message: "Your changes were not
| saved because your edit lock was removed by Mary Tidings on
| 02/20/2004 at 10:01" We make our users talk to each other to
| negotiate locks, and offer the force option for when
| computers crash or people open a record and go to lunch.
|
|       >>>[EMAIL PROTECTED] 02/20 1:45 pm >>>
|
|       Howdy,
|
|       I am working on an intranet type solution, and am
| running into data
|       integrity and record locking concerns.
|
|       The classic problem I want to solve is preventing one
| person from writing
|       over the same record in an update that is being
| performed on the same record
|       as another person.
|
|       1) User #1 loads record detail and begins to edit it.
|       2) User #2 loads same record detail and begins to edit it.
|       3) User #1 saves record to dB.
|       4) User #2 saves record to dB and overwrites #1's changes.
|
|       I know everyone runs into this when dealing with shared
| record sets, so any
|       thoughts on how others have solved this problem?
|
|       Here is my thought on the matter.
|
|       1) User #1 loads record detail and begins to edit it.
|          When record is loaded, an obj is instantiated with
| that records
|       instance data and added into a statefull lock manager.
| (This is locked to
|       avoid race conditions)
|       2) User #2 loads same record detail and begins to edit it.
|          Lock manager checks to see if that obj. already
| exists in it, which
|       it does, so it does not load a new one, but does
| increment the count of the
|       number of people who     have that record open.
|       3) User #1 saves record to dB.
|          After save, the instance data of the obj in the lock
| manager is
|       updated with the saved data, and the count of
| individuals with the record
|       open is deincremented.
|       4) User #2 saves record to dB and overwrites #1's changes.
|          --Attempt to save, the instance data of the object
| to be saved is
|       compared to the instance data of the object in the lock
| manager.  If the
|       data is different, a message is     returned asking
| whether or not they
|       would like to overwrite the new data.
|             --If yes, then the record is saved, and the obj open count
|       in the lock manager is deincremented.
|                --If the open count is 0, then the object is deleted
|       from the lock manager
|                --Else, the object in the lock manager is updated
|       with the newly saved instance data.
|
|       I think there are a couple problems with this:
|          1) Memory consumption.  I think my having to load in
| all these obj
|       in the lock manager, you could potentially crash the
| server ---need some way
|       to control the     amount of objects in the lock manager.
|          2) User leaves open record with out committing to
| the save so the
|       open obj count in the lock manager would never be deincremented.
|          3) I know there are going to be problems relating to RACE
|       conditions....so point them out!!!!
|
|       Any thoughts, feel free to throw this idea up as you
| say 'PULL' and shoot it
|       down =)  I am just starting to figure this out?
|
|       Thanks again,
|
|       Justin
|
|
|
|
|       ----------------------------------------------------------
|       You are subscribed to cfcdev. To unsubscribe, send an email
|       to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
|       in the message of the email.
|
|       CFCDev is run by CFCZone (www.cfczone.org) and supported
|       by Mindtool, Corporation (www.mindtool.com).
|
|       An archive of the CFCDev list is available at
| www.mail-archive.com/[EMAIL PROTECTED]
|
|
###########################################

This message has been scanned by F-Secure Anti-Virus for Microsoft
Exchange.
For more information, connect to http://www.F-Secure.com/


Subject: [CFCDev] OT: invoking C# webservice
Date: Tue, 24 Feb 2004 15:10:52 -0600
From: "Schreck, Thomas (PPC)" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
This is a multi-part message in MIME format.

------_=_NextPart_001_01C3FB1A.AF326BF5
Content-Type: text/plain;
        charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Has anyone invoked a C# webservice using CFMX?

=20

Thanks -

=20

Tom Schreck

817-252-4900

[EMAIL PROTECTED]

=20

I have not failed.  I've found 10,000 ways that won't work.

=20

- Thomas Edison

=20


------_=_NextPart_001_01C3FB1A.AF326BF5
Content-Type: text/html;
        charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40";>

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Has anyone invoked a C# webservice using =
CFMX?<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Thanks =
-<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></fo=
nt></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Tom =
Schreck<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>817-252-4900<o:p></o:p></spa=
n></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>[EMAIL PROTECTED]<o:p><=
/o:p></span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></fo=
nt></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>I have not failed.&nbsp; =
I've found
10,000 ways that won't work.<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></fo=
nt></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>- Thomas Edison</span></font><font face=3DArial><span
style=3D'font-family:Arial'><o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>

------_=_NextPart_001_01C3FB1A.AF326BF5--

From: "Nando" <[EMAIL PROTECTED]>
Subject: RE: [CFCDev] [Kind of OT]: Record Locking and Avoiding Race Condi
tions?
Date: Tue, 24 Feb 2004 23:42:13 +0100
Reply-To: [EMAIL PROTECTED]
What about versioning? In our system, a version of every save is stored. So
for us, in
the scenario described below, Joe and Mary would each have a version stored
that can
be reverted to and made live if necessary. The system also simply stores
versions (as
work in progress) if the user chooses, or if the users permission level does
not allow
them to save a version live to the site.

I just thought that our system could be adapted to use a "lock" as described
below. So
if a particular chuck of content is opened for editing by a user Joe, and
Mary comes
along and opens it, the system would only save a version of Mary's edit and
display a
message to her that Joe is currently working on that same record.

Of course, there is nothing to prevent Mary from opening the record just
after Joe
makes his save, edit it, and discard his changes in this fashion. The "lock"
concept
misses that scenario.



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Hugo Ahlenius
Sent: Tuesday, February 24, 2004 6:57 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] [Kind of OT]: Record Locking and Avoiding Race
Condi tions?


For such a scenario, I think it would be much better to have the lock at
the "checkout" time. I'd hate to write up something, and then be told
that I can't submit it... (even if I talk to someone about it, we would
have the problem of merging our changes)




-------------------------------------------------------------
Hugo Ahlenius                  E-Mail: [EMAIL PROTECTED]
Project Officer                Phone:            +46 8 230460
UNEP GRID-Arendal              Fax:              +46 8 230441
Stockholm Office               Mobile:         +46 733 467111
                               WWW:       http://www.grida.no
-------------------------------------------------------------






| -----Original Message-----
| From: Roland Collins [mailto:[EMAIL PROTECTED]
| Sent: Tuesday, February 24, 2004 17:53
| To: [EMAIL PROTECTED]
| Subject: RE: [CFCDev] [Kind of OT]: Record Locking and
| Avoiding Race Condi tions?
|
| IMO, you're asking for trouble if you have to get users
| talking to resolve locking conflicts.  Irregardless of the
| programmatic bottleneck, you're now introducing a "physical
| world" bottleneck.  And how do you think Mary feels after
| finally clicking "submit", only to be told "Sorry - you've
| been hijacked"?  You're essentially saying that whoever
| clicks "submit" first has the most important data!
|
|
|
| ________________________________
|
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED] On Behalf Of Justin Balog
| Sent: Tuesday, February 24, 2004 11:02 AM
| To: '[EMAIL PROTECTED]'
| Subject: RE: [CFCDev] [Kind of OT]: Record Locking and
| Avoiding Race Condi tions?
|
|
|
| I like the idea of user negotiated locking =)  Does your
| application suffer any performance hits due to the nature of
| the locking in the lock manager?
|
|
|
| Thanks,
|
|
|
| Justin
|
|       -----Original Message-----
|       From: Mark Porter [mailto:[EMAIL PROTECTED]
|       Sent: Monday, February 23, 2004 10:39 AM
|       To: [EMAIL PROTECTED]
|       Subject: Re: [CFCDev] [Kind of OT]: Record Locking and
| Avoiding Race Conditions?
|
|       We come accross this quite a bit. The system we use is
| to create an application structure that is keyed off the id
| of the object being edited. When a user (Joe) obtains a lock,
| his or her userid and a timestamp is added to the structure.
| If another user(Mary) attempts to get a lock they are given a
| message similar to this: "This object was locked for editng
| by Joe Schmoe on 02/20/2004 at 10:00. Click UNLOCK to edit
| this record. THIS MAY DISCARD CHANGES MADE BY JOE SCHMOE."
| Clicking unlock replaces Joe's lock with Mary's. If Joe tries
| to save, he will see the message: "Your changes were not
| saved because your edit lock was removed by Mary Tidings on
| 02/20/2004 at 10:01" We make our users talk to each other to
| negotiate locks, and offer the force option for when
| computers crash or people open a record and go to lunch.
|
|       >>>[EMAIL PROTECTED] 02/20 1:45 pm >>>
|
|       Howdy,
|
|       I am working on an intranet type solution, and am
| running into data
|       integrity and record locking concerns.
|
|       The classic problem I want to solve is preventing one
| person from writing
|       over the same record in an update that is being
| performed on the same record
|       as another person.
|
|       1) User #1 loads record detail and begins to edit it.
|       2) User #2 loads same record detail and begins to edit it.
|       3) User #1 saves record to dB.
|       4) User #2 saves record to dB and overwrites #1's changes.
|
|       I know everyone runs into this when dealing with shared
| record sets, so any
|       thoughts on how others have solved this problem?
|
|       Here is my thought on the matter.
|
|       1) User #1 loads record detail and begins to edit it.
|          When record is loaded, an obj is instantiated with
| that records
|       instance data and added into a statefull lock manager.
| (This is locked to
|       avoid race conditions)
|       2) User #2 loads same record detail and begins to edit it.
|          Lock manager checks to see if that obj. already
| exists in it, which
|       it does, so it does not load a new one, but does
| increment the count of the
|       number of people who     have that record open.
|       3) User #1 saves record to dB.
|          After save, the instance data of the obj in the lock
| manager is
|       updated with the saved data, and the count of
| individuals with the record
|       open is deincremented.
|       4) User #2 saves record to dB and overwrites #1's changes.
|          --Attempt to save, the instance data of the object
| to be saved is
|       compared to the instance data of the object in the lock
| manager.  If the
|       data is different, a message is     returned asking
| whether or not they
|       would like to overwrite the new data.
|             --If yes, then the record is saved, and the obj open count
|       in the lock manager is deincremented.
|                --If the open count is 0, then the object is deleted
|       from the lock manager
|                --Else, the object in the lock manager is updated
|       with the newly saved instance data.
|
|       I think there are a couple problems with this:
|          1) Memory consumption.  I think my having to load in
| all these obj
|       in the lock manager, you could potentially crash the
| server ---need some way
|       to control the     amount of objects in the lock manager.
|          2) User leaves open record with out committing to
| the save so the
|       open obj count in the lock manager would never be deincremented.
|          3) I know there are going to be problems relating to RACE
|       conditions....so point them out!!!!
|
|       Any thoughts, feel free to throw this idea up as you
| say 'PULL' and shoot it
|       down =)  I am just starting to figure this out?
|
|       Thanks again,
|
|       Justin
|
|
|
|
|       ----------------------------------------------------------
|       You are subscribed to cfcdev. To unsubscribe, send an email
|       to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
|       in the message of the email.
|
|       CFCDev is run by CFCZone (www.cfczone.org) and supported
|       by Mindtool, Corporation (www.mindtool.com).
|
|       An archive of the CFCDev list is available at
| www.mail-archive.com/[EMAIL PROTECTED]
|
|
###########################################

This message has been scanned by F-Secure Anti-Virus for Microsoft
Exchange.
For more information, connect to http://www.F-Secure.com/

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]



From: "Roland Collins" <[EMAIL PROTECTED]>
Subject: RE: [CFCDev] [Kind of OT]: Record Locking and Avoiding Race Condi
tions?
Date: Tue, 24 Feb 2004 17:51:19 -0500
Reply-To: [EMAIL PROTECTED]
That's why I'm against this level of programmatic locking - it gets too
complicated too fast, and it is difficult to account for all possible
scenarios.  What if 3 or 4 users get involved in the edit?  Then the whole
shebang falls apart.

Often times simple is better, and I think that the timestamp will do you
well in this scenario.  In fact, if you're using SQL Server or other SQL-92
compliant DB server, you can even use the "timestamp" data type, which is
intended exactly for this purpose.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Nando
Sent: Tuesday, February 24, 2004 5:42 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] [Kind of OT]: Record Locking and Avoiding Race Condi
tions?

What about versioning? In our system, a version of every save is stored. So
for us, in
the scenario described below, Joe and Mary would each have a version stored
that can
be reverted to and made live if necessary. The system also simply stores
versions (as
work in progress) if the user chooses, or if the users permission level does
not allow
them to save a version live to the site.

I just thought that our system could be adapted to use a "lock" as described
below. So
if a particular chuck of content is opened for editing by a user Joe, and
Mary comes
along and opens it, the system would only save a version of Mary's edit and
display a
message to her that Joe is currently working on that same record.

Of course, there is nothing to prevent Mary from opening the record just
after Joe
makes his save, edit it, and discard his changes in this fashion. The "lock"
concept
misses that scenario.



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Hugo Ahlenius
Sent: Tuesday, February 24, 2004 6:57 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] [Kind of OT]: Record Locking and Avoiding Race
Condi tions?


For such a scenario, I think it would be much better to have the lock at
the "checkout" time. I'd hate to write up something, and then be told
that I can't submit it... (even if I talk to someone about it, we would
have the problem of merging our changes)




-------------------------------------------------------------
Hugo Ahlenius                  E-Mail: [EMAIL PROTECTED]
Project Officer                Phone:            +46 8 230460
UNEP GRID-Arendal              Fax:              +46 8 230441
Stockholm Office               Mobile:         +46 733 467111
                               WWW:       http://www.grida.no
-------------------------------------------------------------






| -----Original Message-----
| From: Roland Collins [mailto:[EMAIL PROTECTED]
| Sent: Tuesday, February 24, 2004 17:53
| To: [EMAIL PROTECTED]
| Subject: RE: [CFCDev] [Kind of OT]: Record Locking and
| Avoiding Race Condi tions?
|
| IMO, you're asking for trouble if you have to get users
| talking to resolve locking conflicts.  Irregardless of the
| programmatic bottleneck, you're now introducing a "physical
| world" bottleneck.  And how do you think Mary feels after
| finally clicking "submit", only to be told "Sorry - you've
| been hijacked"?  You're essentially saying that whoever
| clicks "submit" first has the most important data!
|
|
|
| ________________________________
|
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED] On Behalf Of Justin Balog
| Sent: Tuesday, February 24, 2004 11:02 AM
| To: '[EMAIL PROTECTED]'
| Subject: RE: [CFCDev] [Kind of OT]: Record Locking and
| Avoiding Race Condi tions?
|
|
|
| I like the idea of user negotiated locking =)  Does your
| application suffer any performance hits due to the nature of
| the locking in the lock manager?
|
|
|
| Thanks,
|
|
|
| Justin
|
|       -----Original Message-----
|       From: Mark Porter [mailto:[EMAIL PROTECTED]
|       Sent: Monday, February 23, 2004 10:39 AM
|       To: [EMAIL PROTECTED]
|       Subject: Re: [CFCDev] [Kind of OT]: Record Locking and
| Avoiding Race Conditions?
|
|       We come accross this quite a bit. The system we use is
| to create an application structure that is keyed off the id
| of the object being edited. When a user (Joe) obtains a lock,
| his or her userid and a timestamp is added to the structure.
| If another user(Mary) attempts to get a lock they are given a
| message similar to this: "This object was locked for editng
| by Joe Schmoe on 02/20/2004 at 10:00. Click UNLOCK to edit
| this record. THIS MAY DISCARD CHANGES MADE BY JOE SCHMOE."
| Clicking unlock replaces Joe's lock with Mary's. If Joe tries
| to save, he will see the message: "Your changes were not
| saved because your edit lock was removed by Mary Tidings on
| 02/20/2004 at 10:01" We make our users talk to each other to
| negotiate locks, and offer the force option for when
| computers crash or people open a record and go to lunch.
|
|       >>>[EMAIL PROTECTED] 02/20 1:45 pm >>>
|
|       Howdy,
|
|       I am working on an intranet type solution, and am
| running into data
|       integrity and record locking concerns.
|
|       The classic problem I want to solve is preventing one
| person from writing
|       over the same record in an update that is being
| performed on the same record
|       as another person.
|
|       1) User #1 loads record detail and begins to edit it.
|       2) User #2 loads same record detail and begins to edit it.
|       3) User #1 saves record to dB.
|       4) User #2 saves record to dB and overwrites #1's changes.
|
|       I know everyone runs into this when dealing with shared
| record sets, so any
|       thoughts on how others have solved this problem?
|
|       Here is my thought on the matter.
|
|       1) User #1 loads record detail and begins to edit it.
|          When record is loaded, an obj is instantiated with
| that records
|       instance data and added into a statefull lock manager.
| (This is locked to
|       avoid race conditions)
|       2) User #2 loads same record detail and begins to edit it.
|          Lock manager checks to see if that obj. already
| exists in it, which
|       it does, so it does not load a new one, but does
| increment the count of the
|       number of people who     have that record open.
|       3) User #1 saves record to dB.
|          After save, the instance data of the obj in the lock
| manager is
|       updated with the saved data, and the count of
| individuals with the record
|       open is deincremented.
|       4) User #2 saves record to dB and overwrites #1's changes.
|          --Attempt to save, the instance data of the object
| to be saved is
|       compared to the instance data of the object in the lock
| manager.  If the
|       data is different, a message is     returned asking
| whether or not they
|       would like to overwrite the new data.
|             --If yes, then the record is saved, and the obj open count
|       in the lock manager is deincremented.
|                --If the open count is 0, then the object is deleted
|       from the lock manager
|                --Else, the object in the lock manager is updated
|       with the newly saved instance data.
|
|       I think there are a couple problems with this:
|          1) Memory consumption.  I think my having to load in
| all these obj
|       in the lock manager, you could potentially crash the
| server ---need some way
|       to control the     amount of objects in the lock manager.
|          2) User leaves open record with out committing to
| the save so the
|       open obj count in the lock manager would never be deincremented.
|          3) I know there are going to be problems relating to RACE
|       conditions....so point them out!!!!
|
|       Any thoughts, feel free to throw this idea up as you
| say 'PULL' and shoot it
|       down =)  I am just starting to figure this out?
|
|       Thanks again,
|
|       Justin
|
|
|
|
|       ----------------------------------------------------------
|       You are subscribed to cfcdev. To unsubscribe, send an email
|       to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
|       in the message of the email.
|
|       CFCDev is run by CFCZone (www.cfczone.org) and supported
|       by Mindtool, Corporation (www.mindtool.com).
|
|       An archive of the CFCDev list is available at
| www.mail-archive.com/[EMAIL PROTECTED]
|
|
###########################################

This message has been scanned by F-Secure Anti-Virus for Microsoft
Exchange.
For more information, connect to http://www.F-Secure.com/

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]



From: Dave Watts <[EMAIL PROTECTED]>
Subject: RE: [CFCDev] OT: invoking C# webservice
Date: Tue, 24 Feb 2004 19:26:50 -0500
Reply-To: [EMAIL PROTECTED]
> Has anyone invoked a C# webservice using CFMX?

Yes. You may have problems when working with .NET datasets, or with other
complex types. You may also have problems with complex WSDL like that used
by the MapPoint service. If you post what you're trying to do, someone may
have an answer.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444


From: "Tony Weeg" <[EMAIL PROTECTED]>
Subject: RE: [CFCDev] OT: invoking C# webservice
Date: Tue, 24 Feb 2004 19:56:23 -0500
Reply-To: [EMAIL PROTECTED]

the code below does :) and works quite nicely :)

tony


<!--- invoke first webservice method, validateUser --->

        <cfinvoke 
        
webservice="https://www.navtrak.net/StreetSuiteAPI/SSClientAPI/StreetSui
te.asmx?wsdl" 
                method="ValidateUser" 
                user="{username}" pass="{password}" 
                returnvariable="xmlReturn">

        <cfset xmlReturn = xmlParse(xmlReturn)>

        <cfset userIdNumber = xmlSearch(xmlReturn,'/LOGACK/Userid')>
        <cfset password = xmlSearch(xmlReturn,'/LOGACK/GUID')>  

<!--- invoke second webservice with values from first invocation --->
        
<cfinvoke 
        
webservice="https://www.navtrak.net/StreetSuiteAPI/SSClientAPI/StreetSui
te.asmx?wsdl" 
                method="AssetHistoryTimeFrame" 
                returnvariable="xmlReturnAddressHistory">
                
                <cfinvokeargument name="UserId"
value="#userIdNumber[1].xmlText#">
                <cfinvokeargument name="Password"
value="#password[1].xmlText#">
                <cfinvokeargument name="StartDate" value="02/03/2004
20:00:00.000">          
                <cfinvokeargument name="EndDate" value="02/03/2004
23:59:59.999">                          
                <cfinvokeargument name="NetworkId" value="{ip address
here}">                         
                
</cfinvoke>
        
        <cfset xmlReturnVehicleHistory =
xmlParse(xmlReturnAddressHistory)>



....tony

r e v o l u t i o n w e b d e s i g n 
[EMAIL PROTECTED]
www.revolutionwebdesign.com

its only looks good to those who can see bad as well
-anonymous

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Dave Watts
Sent: Tuesday, February 24, 2004 7:27 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] OT: invoking C# webservice


> Has anyone invoked a C# webservice using CFMX?

Yes. You may have problems when working with .NET datasets, or with
other complex types. You may also have problems with complex WSDL like
that used by the MapPoint service. If you post what you're trying to do,
someone may have an answer.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]

----------------------------------------------------------
You are subscribed to cfcdev in Digest Mode. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message
of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to