Well anyone who puts user interaction between trnsactions should be shot.

But to day that a transaction should only ever run for 10ms, and if it goes
out to 50ms is not a good call either.

I have developed applications that have been very complex in the
calculations, and rely heavily on day being stored i numerous tables, and
can go out as far as 200ms. Now this is not that much of a perfomance hit in
this case, because that is as optimised as that code is ever going to get.

I agree with what you saying, but disagree that you should never do it my
example showed ORM processing that had more logic to build the queries and
this is by your definition a no no.



On 3/5/07, Tom Kitta <[EMAIL PROTECTED]> wrote:
>
> I stand by my previous claim - transactions are used by DBs to set locking
> level. Locking is not good for performance. Locking leads to blocking and
> that can slow down your DB and thus your application down to a crawl. If
> this extra code in the transaction is happening once in a while than it is
> OK (within limits, like say 10ms). We are talking here about tasks that
> will
> take a long time more than say few ms, like 50ms or something like that.
> Calling functions from cftransaction tag that execute a query is treated
> as
> SQL, calling a function to do an FTP operation is a definite NO.
>
> There is even a classic example in some of the Adobe CF notes - don't
> place
> user interaction code in cftransaction tag - I don't even go as far as
> such
> extremes,
>
> TK
> ----- Original Message -----
> From: "Andrew Scott" <[EMAIL PROTECTED]>
> To: "CF-Talk" <cf-talk@houseoffusion.com>
> Sent: Sunday, March 04, 2007 5:54 PM
> Subject: RE: <cftransaction> Question
>
>
> > 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" <cf-talk@houseoffusion.com>
> > Sent: Sunday, March 04, 2007 1:31 PM
> > Subject: <cftransaction> Question
> >
> >
> >> Hi Everyone
> >>
> >> I am using cftransaction around few things
> >> 1> Reading a file to my local from ftp site
> >> 2> query to insert
> >> 3> query to loop and do some operations
> >> 4> zip files
> >>
> >> Now according cftransaction if there is any error in these
> >> functionalities, it should rollback to the initial stage right? But its
> >> not working in my case.
> >> It picks the file from ftp to local, then there is an error in query,
> it
> >> stops there but doesn't rollback ( i mean it doesn't remove the file
> read
> >> on local ). It should remove the file read through FTP rite?
> >>
> >> Code Used:
> >> <cftransaction>
> >> <cftry>
> >> 1- FTP read
> >> 2-Query ( Error one)
> >>
> >> <cftransaction action="commit" />
> >> <cfcatch type="tran">
> >> <cftransaction action="rollback" />
> >> <cfset request.lstErrorMessages =
> >> ListAppend(request.lstErrorMessages,cfcatch.message)>
> >> </cfcatch>
> >> <cfcatch type="any">
> >> <cftransaction action="rollback" />
> >> <cfset request.lstErrorMessages =
> >> ListAppend(request.lstErrorMessages,cfcatch.message)>
> >> </cfcatch>
> >> </cftry>
> >> </cftransaction>
> >> Can anyone help[ me with this one. what is wrong with this approach?
> >>
> >> DG
> >>
> >>
> >
> >
> >
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271488
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