Sorry....Knew I was forgetting something.
<cflock name="#session.st#ProcessLock" timeout="20" type="exclusive">
<CFTRANSACTION isolation="serializable" action="begin">
<cfif IsDefined("session.Order.ReqNumber")>
<cfset RequisitionNumber=session.Order.ReqNumber>
<cfelse>
<cfinvoke component="ReqNumbering"
method="GetNumber" clientBasedPID="#ClientBasedPID#"
returnvariable="RequisitionNumber">
<cfif RequisitionNumber is 0>
<cftransaction action="rollback"/>
<cfset TransactionFailure=1>
<cfexit method="exittag">
</cfif>
</cfif>
<cfstoredproc procedure="LTCalls_LoadTable"
datasource="#session.datasource#" returncode="true">
<cfprocparam cfsqltype="CF_SQL_VARCHAR" type="in"
value="reqs"><!--- Table To Update --->
<cfprocparam cfsqltype="CF_SQL_LONGVARCHAR"
type="in" value="#FieldValuePairs#"><!--- List of Field/Value Pairs --->
<cfprocparam cfsqltype="CF_SQL_CHAR" type="in"
value=""><!--- ID of Row to Update --->
<cfprocparam cfsqltype="CF_SQL_CHAR" type="in"
value="|^|"><!--- Field/Value Pair Delimiter --->
<cfprocparam cfsqltype="CF_SQL_CHAR" type="in"
value="|=|"><!--- Field/Value Delimiter --->
</cfstoredproc>
<cfif cfstoredproc.statusCode eq 0>
<!---retrieves the req number--->
<cftransaction action="commit"/>
<cfelse>
<cftransaction action="rollback"/>
<cfset TransactionFailure=1>
</cfif>
</cftransaction>
</cflock>
> -----Original Message-----
> From: Adrian Lynch [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 18, 2007 5:34 AM
> To: CF-Talk
> Subject: RE: Exclusive locks still producing duplicate values
>
> Can we see your locking code?
>
> Adrian
>
> -----Original Message-----
> From: Dave
> Sent: 17 December 2007 22:03
> To: CF-Talk
> Subject: Exclusive locks still producing duplicate values
>
>
> We have have an issue here that I thought I had solved via
> locking and transactions, but it appears that the issue still exists.
>
> Basically, our clients go through an order entry process that
> produces a numbered requisition. The number is based upon a
> value that is stored in the database for each client.
> Multiple users of the same client can obviously place orders
> simultaneously all drawing their base number from the same
> location. The section of code that actually creates the req
> number and stores the data is run within a serialized
> transaction that sits within an exclusive named lock. If I'm
> understanding locking correctly, the exclusive named lock
> should prevent any other execution of that same code within
> the same application. The serialized transaction should
> restrict access to the tables required to that single
> transaction, again if I'm understanding it correctly.
>
> The requisition number is actually created in a function
> invoked within this lock/transaction block so it should be
> restricted from use until the lock is released. The problem
> is that we still seem to be getting duplicate requisition
> numbers generated through this process. There are several
> ways to reach the point of creating the order, but the final
> order build is all processed through this code.
>
> There must be something that I am missing, but I can't for
> the life of me see what it is. Any help is appreciated.
>
> TYIA
> David Phelan
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:294997
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4