You can still have it roll back if there's a CF error within your
cftransaction block. Just use cftry/catch block and if there's a cf
error you can explicitly call the cftransaction "rollback" inside the
catch and voila!

Stace

-----Original Message-----
From: Schreck, Tom [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 16, 2004 9:31 AM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] cftransaction

Yes, it was an IO problem on my end.  I did not realize it would only
roll
back if the error occurs while interacting with the database.  I assumed
if
any error occurs within <cftransaction> block then the data would be
rolled
back.  Makes sense now.

I tested this by deleting the table I'm trying to write data to in the
second method call.  Sure enough, the data inserted in first method call
was
rolled back.  I removed the <cftransaction> tags and ran the code again
and
this time the data in first method call was entered into the table.

Thanks for your help and clarification.

Tom Schreck
972-361-9943

-----Original Message-----
From: Schreck, Tom [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 16, 2004 7:31 AM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] cftransaction

It must be an IO (idiot operator) problem on my part.  I'll have to test
it
again.

Thanks
 
Tom Schreck
972-361-9943

-----Original Message-----
From: Stacy Young [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 15, 2004 4:29 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] cftransaction


I do a similar approach and works perfectly! Actually its usually a
single CFC method invocation which in turn will kick off numerous
others. At any point there's a failure everything rolls back. You sure
your DB supports transactions? i.e. MySQL you need to use InnoDB tables
etc

Stace

-----Original Message-----
From: Schreck, Tom [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 15, 2004 4:41 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] cftransaction

All of my database processing is done through CFCs.  Basically, I have
an
action.cfm page where I invoke a series of CFCs and call specific
functions
of those CFCs.  I tried wrapping <cftransaction> around function calls
in my
action.cfm page thinking it would roll back any changes made in the
called
CFCs.  But that is not the case.

If I moved the <cftransaction> down inside of CFC, then that does me no
good
because it has no control over subsequent CFC calls.  So, from my
perspective, cftransaction is useless.

Thanks
 
Tom Schreck
972-361-9943

-----Original Message-----
From: Dave Watts [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 15, 2004 3:23 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] cftransaction

> I'm having an issue with <cftransaction> working as I think 
> it should.  In my action page, I wrap a series of CFC 
> invocations and method calls inside a <cftransaction> in the 
> hope that if a method fails then all will be rolled back.  
> This is not happening.  The processing that occurs prior to 
> the failure is not being rolled back.  Does anyone have 
> insight to this issue please?

The CFTRANSACTION tag only affects database interaction using the same
database connection. It doesn't affect what happens with CF code,
specifically. So, unless your CFC invocations and method calls do
nothing
but database interaction, CFTRANSACTION will not roll their changes
back.

In addition, there have been some known issues with using CFTRANSACTION
to
roll back database changes made using CFCs. I don't know if they've all
been
resolved. I would generally recommend that you perform transactional
logic
within the database rather than within CF if possible.

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
[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
[EMAIL PROTECTED]



<table width=800 cellpadding=4 cellspacing=10 border=0><tr
bgcolor=BDBDBD><td valign=top width=400><font face=verdana size=2
color=FFFFFF><b>AVIS IMPORTANT</b></font></td><td valign=top
width=400><font
face=verdana size=2 color=FFFFFF><b>WARNING</b></font></td></tr><tr><td
valign=top width=400><p align=justify><font face=verdana size=1
color=808080> Les informations contenues dans le present document et ses
pieces jointes sont strictement confidentielles et reservees a l'usage
de la
(des) personne(s) a qui il est adresse. Si vous n'etes pas le
destinataire,
soyez avise que toute divulgation, distribution, copie, ou autre
utilisation
de ces informations est strictement prohibee. Si vous avez recu ce
document
par erreur, veuillez s'il vous plait communiquer immediatement avec
l'expediteur et detruire ce document sans en faire de copie sous quelque
forme.</td><td valign=top width=400><p align=justify><font face=verdana
size=1 color=808080> The information contained in this document and
attachments is confidential and intended only for the person(s) named
above.
If you are not the intended recipient you are hereby notified that any
disclosure, copying, distribution, or any other use of the information
is
strictly prohibited. If you have received this document by mistake,
please
notify the sender immediately and destroy this document and attachments
without making any copy of any kind.</td></tr></table>

----------------------------------------------------------
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
[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
[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
[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 
[EMAIL PROTECTED]

Reply via email to