So is this, kind of.  I grabbed it out of the Allaire KB quite awhile ago.  Turned it 
into a custom tag.  No idea if MX has an internal fix rather than this:

<!--- 
<CF_CVExpire
        DSN="DSNName"
        Timeout=number of days>
--->
<!--- get the timeout --->
<CFPARAM NAME="attributes.Timeout" Default="10" TYPE="numeric">

<!--- construct the ODBC timestamp for the timeout --->
<CFSET 
variables.ExpireDate=CreateODBCDateTime(Now()-CreateTimeSpan(attributes.Timeout,0,0,0))>

<!--- Run the query to find the IDs which should be expired --->
<CFQUERY 
        Name="Expired" 
        Datasource="#attributes.DSN#">
    SELECT CGLOBAL.cfid FROM CGLOBAL WHERE CGLOBAL.lvisit < #variables.ExpireDate#
</CFQUERY>

<!--- loop over query and delete records from CDATA table --->
<CFLOOP Query="Expired">
  <CFQUERY 
        Name="Deleted" 
        DataSource="#attributes.DSN#">
    DELETE FROM CDATA WHERE CDATA.cfid='#Expired.cfid#'
  </CFQUERY>
</CFLOOP>

<!--- Now delete records from CGLOBAL table --->
<CFQUERY 
        Name="Deleted" 
        DataSource="#attributes.DSN#">
  DELETE FROM CGLOBAL WHERE CGLOBAL.lvisit < #variables.ExpireDate#
</CFQUERY>
<CFSET caller.TextMsg="Purged client data from Data Source '"&#attributes.DSN#&"' last 
visit older than "&#variables.ExpireDate#&" Records Deleted: 
"&#Expired.RecordCount#&".">



---------------------------------------
Matt Robertson    [EMAIL PROTECTED]
MSB Designs, Inc., www.mysecretbase.com
---------------------------------------


---------- Original Message ----------------------------------
from: "James Smith" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
date: Tue, 4 Jun 2002 23:45:29 +0100

I would be interested in this, I use MySQL and the workround I have is VERY
messy.

--
Jay

----- Original Message -----
From: "Matt Robertson" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, June 04, 2002 11:38 PM
Subject: Re: Client Variable Storage: Trouble Purging


> Whats your db platform?  If its mySQL, CF can't purge it (although a
workaround was published some time ago that you can cfschedule).  Let me
know if you need it and I'll post it.
>
> ---------------------------------------
> Matt Robertson    [EMAIL PROTECTED]
> MSB Designs, Inc., www.mysecretbase.com
> ---------------------------------------
>
>
> ---------- Original Message ----------------------------------
> from: Jamie Jackson <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> date: Tue, 04 Jun 2002 18:17:52 -0400
>
> Two questions:
>
> *My registry seems to be corrupted, though it's hard to say. It has
> swollen with client variables, and CF *seems* not to be able to purge
> the old ones after the designated period. Is there a way to manually
> purge them? I can't view the CF key in regedit, as regedit eats up
> RAM/virtual memory when I try to access the CF part of the registry.
>
> *Same sort of issue with DB client stores: CF isn't properly purging
> unused client variables. It looks as though all rows created so far
> (since ~1 week ago) are still there, though CF's supposed to clean
> unused client variables after a day. Isn't CF supposed to handle these
> deletes, or do I need to implement a DB job to handle it?
>
> Thanks,
> Jamie
>
> 

______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to