A side note on this. it all works on 6.0.
Ian
On Tue, 21 Sep 2004 16:37:45 -0400, Ian Sheridan <[EMAIL PROTECTED]> wrote:
> OK I will send a text file out.
>
>
>
>
> On Tue, 21 Sep 2004 16:35:32 -0400, Roland Collins <[EMAIL PROTECTED]> wrote:
> > Check the log files for errors as well, not just the screens. It would also
> > be helpful if we could see the other functions that you have written that
> > this one calls.
> >
> >
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> > Of Ian Sheridan
> > Sent: Tuesday, September 21, 2004 4:28 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [CFCDev] A Frustrating Function
> >
> > that's my problem. I am not getting and error. the server spikes and I
> > have to kill the cfserver.
> >
> > no error message... nothing. ugh!
> >
> > Ian
> >
> > On Tue, 21 Sep 2004 15:25:38 -0500, Raymond Camden <[EMAIL PROTECTED]>
> > wrote:
> > > I don't suppose you could share the error?
> > >
> > >
> > ===========================================================================
> > > Raymond Camden, Director of Development for Mindseye, Inc
> > (www.mindseye.com)
> > > Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)
> > >
> > > Email : [EMAIL PROTECTED]
> > > Blog : www.camdenfamily.com/morpheus/blog
> > > Yahoo IM : morpheus
> > >
> > > "My ally is the Force, and a powerful ally it is." - Yoda
> > >
> > > > -----Original Message-----
> > > > From: [EMAIL PROTECTED]
> > > > [mailto:[EMAIL PROTECTED] On Behalf Of Ian Sheridan
> > > > Sent: Tuesday, September 21, 2004 3:24 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [CFCDev] A Frustrating Function
> > > >
> > > > Alright, I need some help. I have a function that is crashing
> > > > CF6.1 and I have absolutely no idea why. I have tested all
> > > > the functions that are referred to within this code
> > > > separately and they worked fine.
> > > > This is a simple function logging a user's entry into the
> > > > system. You will notice a query function I abstracted the
> > > > cfquery tag so that I could use it in cfscript.
> > > >
> > >
> > >
> > > ----------------------------------------------------------
> > > 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
> > www.mail-archive.com/[EMAIL PROTECTED]
> > >
> >
> > --
> >
> > ----------------------
> > Ian Sheridan
> > http://www.savagevines.com
> > ----------------------
> > ----------------------------------------------------------
> > 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
> > www.mail-archive.com/[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 www.mail-archive.com/[EMAIL
> > PROTECTED]
> >
>
>
>
>
> --
>
> ----------------------
> Ian Sheridan
> http://www.savagevines.com
> ----------------------
>
--
----------------------
Ian Sheridan
http://www.savagevines.com
----------------------
<!--- QUERY --->
<cffunction name="query" access="public" returntype="struct">
<cfargument name="str" type="string" required="true">
<cfargument name="cache" type="string" required="false"
default="#createtimespan(0,0,0,0)#" hint="Requires a time span created with
'CreateTimeSpan'.">
<cfset var o = StructNew() />
<cfif this.datasource NEQ "">
<cftry>
<cfquery datasource="#this.datasource#"
name="o.result"
cachedWithin="#arguments.cache#">#PreserveSingleQuotes(arguments.str)#</cfquery>
<cfscript>
o.message = "ExecutionTime: " &
cfquery.ExecutionTime & "ms ";
o.pass = true;
</cfscript>
<cfcatch type="database">
<cfscript>
o.result = "";
o.message = "<p>The query did nto go
through.</p> ";
o.message = o.message &
"<p><strong>#cfcatch.type#</strong><br> ";
o.message = o.message &
"#cfcatch.detail#<br /> ";
o.message = o.message & "system
message: #cfcatch.message#<br /> ";
o.message = o.message & "<br /> ";
n = arraylen(cfcatch.tagcontext);
if (ArrayLen(CFCATCH.TAGCONTEXT) IS
NOT 0) {
stackText = "The contents of
the tag stack are:" & "<br /> " & "<br /> ";
n =
ArrayLen(CFCATCH.TAGCONTEXT);
for (i=1;i LTE n;i=i+1) {
sCurrent =
CFCATCH.TAGCONTEXT[i];
o.message = o.message
& "#i# ----------------- " & "<br /> ";
keylist =
structkeylist(sCurrent);
keylen =
listlen(keylist);
for (j=1;j LTE
keylen;j=j+1) {
o.message =
o.message & "#listgetat(keylist,j)#: #sCurrent['#listgetat(keylist,j)#']#" & "<br /> ";
}
o.message = o.message
& "<br /> ";
}
} else {
o.message = o.message & "The
tag stack is empty (it might have been disabled in the ColdFusion administrator)";
o.message = o.message & "<br
/> ";
}
o.message = o.message & "<strong>SQL
statement:</strong> <pre>#arguments.str#</pre><br /> ";
o.message = o.message &
"#cfcatch.NativeErrorCode#<br /> ";
o.message = o.message &
"#cfcatch.SQLState#</p>";
o.pass = false;
</cfscript>
</cfcatch>
</cftry>
<cfelse>
<cfscript>
o.result = querynew("nodatasource");
o.message = "The object was not constructed.";
o.pass = false;
</cfscript>
</cfif>
<cfreturn o>
</cffunction>
<!--- IDGEN - legacy stuff I have to use --->
<cffunction name="idGen" access="public" returntype="string" hint="<h4>This is
a Utility Funtion</h4><p>This funtion is used to generate the unique ID for newly
created records. This function need to have a makecid directory off of the root
directory of the applicaqtion.</p>">
<cfargument name="approot" hint="this the the application root."
required="true" default="./">
<cfset var naw = now() >
<cfset var todaydate = "" >
<cfset var ccfile = "" >
<cfset var todaytime = "" >
<cfset var myRandomInt = "" >
<cfset var CountFile = "" >
<cfset var r = "" >
<cfset var mynum = "" >
<cfset var cidname = "" >
<cfset var count = "" >
<cfscript>
todaydate = DateFormat(naw, "yyyymmdd");
ccfile = "#todaydate#";
ccfile = Insert("cc", '#ccfile#', 0);
todaytime = TimeFormat(naw, "HHmmss");
myRandomInt = TimeFormat(naw, "ss");
CountFile = arguments.approot & "makecid/#ccfile#";
</cfscript>
<cflock name="makecidlock" type="exclusive"
timeout="#createtimespan(0,0,0,1)#" throwontimeout="true">
<cfif fileexists(countfile)>
<cffile action="read" file="#countfile#"
variable="count">
<cfelse>
<cffile action="write" file="#countfile#" output="1">
<cfset count = 1>
</cfif>
</cflock>
<cfscript>
myRandomInt = myRandomInt & count;
r = Randomize(myRandomInt);
mynum = Rand();
mynum = Mid(mynum, 3, 3);
cidname = todaydate & todaytime & mynum;
count = count + 1 ;
</cfscript>
<cflock name="makecidlock" type="exclusive"
timeout="#createtimespan(0,0,0,1)#" throwontimeout="true">
<cffile action="write" file="#countfile#"
output="#tostring(count)#">
</cflock>
<cfreturn cidname>
</cffunction>
<!--- the function that I have pinned this issue down to. --->
<cffunction name="logLogin" displayname="LogLogin" output="no" access="public"
returntype="struct" hint="">
<cfargument name="approot" type="string" required="true" hint="the
Application Root Directory">
<cfargument name="userlogin" type="string" required="true" hint="LOGIN
of user">
<cfset var o = structnew() />
<cfset var t = structnew() />
<cfscript>
// init
t.id = idgen( approot="#arguments.approot#" );
// build query
t.sql = "
insert into pmsuserlog (logid, userlogin, logstatus)
values (#t.id#, '#arguments.userlogin#', 'IN')
";
// get output
t.output = query(t.sql);
o.result = t.output.result;
o.message = t.output.message;
o.pass = t.output.pass;
</cfscript>
<cfreturn o >
</cffunction>