Ryan Farrell wrote:

> Basically, this is what I'm doing, which works just fine on a single 
> app server.  Multiple servers would be a problem, though.  Many thanks.
>
> < cflock timeout="30" name="insertpayment">
>       < cfquery name="inserttrans" datasource="#ds#">
>               insert into tblpayment . . .
>       </ cfquery>
>               
>       < cfquery name="gettrans" datasource="#ds#">
>               select max(transid) as transid from tblpayment
>       </ cfquery>
> </ cflock>

That would require a serializable transaction. Make sure you test that 
your drivers support this correctly. Pseudo code:

<cftransaction isolation="serializable">
   <cfquery name="inserttrans" datasource="#ds#">
     insert into tblpayment . . .
   </cfquery>
   <cflock timeout="30" name="db" type="readonly">
     <cflock timeout="10" name="db" type="exclusive" throwontimeout="no">
     </cflock>
   </cflock>
   <cfquery name="gettrans" datasource="#ds#">
     select max(transid) as transid from tblpayment
   </cfquery>
</cftransaction>

Starting 2 of these at aproximately the same time will tell you whether 
it works correctly.

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=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.

Reply via email to