Andrew, don't take this as gospal, but yes, they seem to come under the
outside methods' transaction


<cftrans... >
        <cfset bOK  = myLocalMethod1(params)>
        <cfloop ..>
                <cfset bOK  = myLocalMethod2(params)>
        </cfloop>
</cftrans>

 
it seems that you can also add in methods from other CFC's 
PROVIDED: you instanciate the CFC within the outer method

<cfset obj = createobject(etc...)>
<cftrans... >
        <cfset bOK  = myLocalMethod1(params)>
        <cfset bOK  = obj.myRemoteMethod2(params)>
</cftrans>


NOTE: if you try to reference an existing object (created elsewhere)
within the transaction, you get a "not in local transaction mode" error
(or such)

I say "don't take this as gospal" because I'd like to see what's
happening "under the hood" with CF.

if this was Microsoft's ADO then it'd all make sence (you control the
connection to the db explicitly) but CF abstracts what the underlying
Java is doing and I'm having trouble finding a definitive expaination of
how cftransaction actually works with the underlying java.

eg: will cftransaction cause only one connection to the db, no matter
how many cfquery's you run? doubtful but how do you know?

all the MM docs I've read are piss-weak in explaining exactly what's
happening. All they give you is a the typical 4GL view as seen from a CF
programmers view. woefully inadequate.

this is the best (least useless) I've found
http://www.macromedia.com/devnet/mx/coldfusion/articles/cftransaction.ht
ml


hope it helps. any wrong assumptions, please correct me

cheers
barry.b


-----Original Message-----
From: Andrew Scott [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 29 July 2004 8:39 AM
To: CFAussie Mailing List
Subject: [cfaussie] CFTransaction and CFC's


I am working on something at the moment where I will call another
function
within a cfc, but before I start going into all the coding I was hoping
that
someone might be able to clear something up for me.

I have a loop within a cftransaction that will call another cfc (this is
the
idea anyway), that will check for existence within a database and then
store
it in there if necessary.

Ok here is the problem (question). Is it possible to call another
function
and expect the calling function's cftransaction to handle commit and
rollback of errors provided by other functions, provided it is within a
cftry block?

Example

Function()
{
  try
  {
   cftransaction
    CheckExistance();
    InsertInformation();
   /cftransaction
  }
  catch (e)
  {
    ....error handling
  }
}

 
Regards
Andrew Scott
Technical Consultant

NuSphere Pty Ltd
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9686 0485  -  Fax: 03 9699 7976


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to