Scott is not here at the moment, but maybe I can answer the question for
you.

Yes until the final cftransaction you will not see the data in the database,
but having said that.

<cftransaction>
</cftransaction>

In your case the sql query to read doesn't need to be in the cftransaction,
you can place a cftry around the block and make it fail past the sql read if
the transaction fails for any reason.

HTH


Andrew Scott
Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613  8676 4223
Mobile: 0404 998 273



-----Original Message-----
From: Deepak Gupta [mailto:[EMAIL PROTECTED] 
Sent: Monday, 5 March 2007 12:48 PM
To: CF-Talk
Subject: Re: <cftransaction> Question

Scott

Suppose I have 2 queries in cftransaction
1- inserts into database
2 reads from database
Then <cftransaction action="commit">

is it only after the commit i will be able to see the values in the
database?
my 1st insert is " load data infile" somehow i cant see my results in
database during the process and it is able to get results out of second
query that means there is something in DB, but why can't i see it?

when i do load data infile in a cftransaction i cant see results in DB

Do you have any suggestion

DG 


>Tom,
>
>The statement about, You should only use cftransaction tag to make sequence
>of SQL statements into one atomic unit.
>
>Is Correct.
>
>Your Statement about, You should never have anything inside your 
>cftransaction block that is not SQL related especially if its going to take

>a long time (i.e. more than few ms).
>
>Is not Correct, in the instance of objects and dao's it is the only way to
>achieve a transaction for your queries, for example.
>
><cftransaction>
> <cfset copyRecord = object.Load(id=100) />
> <cfset newObject = Object.CreateRecord() />
> <cfset newObject.setItem(copyRecord.getItem()) />
> <cfset fileObject.SaveImage(form.Somefilename) />
> <cfset newObject.Save(false) />
></cftransaction>
>
>Now to role this back for files, you will need to wrap the entire thing in
a
>cftry block, so that you can delete or whatever you need to do with the
>maintenance of the file.
>
>
>
>Andrew Scott
>Senior Coldfusion Developer
>Aegeon Pty. Ltd.
>www.aegeon.com.au
>Phone: +613  8676 4223
>Mobile: 0404 998 273
>
>
>
>-----Original Message-----
>From: Tom Kitta [mailto:[EMAIL PROTECTED] 
>Sent: Monday, 5 March 2007 10:20 AM
>To: CF-Talk
>Subject: Re: <cftransaction> Question
>
>You should only use cftransaction tag to make sequence of SQL statements 
>into one atomic unit. You should never have anything inside your 
>cftransaction block that is not SQL related especially if its going to take

>a long time (i.e. more than few ms). You don't want to lock your SQL server

>DBs because some operation such as FTP is taking place.
>
>cftransaction  will rollback if there is an error in the SQL executed
within
>
>it. You can also use the rollback option to rollback on some user error.
The
>
>rollback here refers only to SQL.
>
>To answer your question, no cftransaction will not delete any files etc.
for
>
>you, it is only for SQL.
>
>TK
>----- Original Message ----- 
>From: "Deepak Gupta" <[EMAIL PROTECTED]>
>To: "CF-Talk" <[email protected]>
>Sent: Sunday, March 04, 2007 1:31 PM
>Subject: <cftransaction> Question



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by Adobe®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271474
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to