tag:blogger.com,1999:blog-37895971704324660582024-03-08T02:38:22.814-07:00Fusecast LLC, Web development, Coldfusion 8, CFML, Flash, JavaScript, Web Hosting ServiceFusecast LLC specializes in Coldfusion and Flash hosting and development services. We have thousands of website designs at the ready for any project you have. www.fusecast.comSteve H.http://www.blogger.com/profile/07013507015876931939noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-3789597170432466058.post-62901971959845561592009-06-30T13:08:00.003-06:002009-06-30T13:21:05.792-06:00Solution to CFIMAGE distorting text.CFIMAGE, CFPDF and CFDOCUMENT all rely on the Fonts installed on the server where Coldfusion is installed.<br /><br />You may find as I did that these tags sometimes render fonts strangly. In my case it was CFIMAGE that was drawing out strange characters for letters. I googled the issue and found NO good answer. Adobe's forums didn't help either.<br /><br />So here is the solution! For FREE!<br /><br />The CFIMAGE tag contains an attribute called "fonts". To stop having CF pull random fonts, you must open up your CFADMIN console (if you have access to it) and look in the Font Management section or TRUE TYPE fonts.<br /><br />On my server I have several fonts listes but only few are TRUE TYPE.<br /><br />ONLY True type will work (in my experience).<br /><br />Copy and paste one of the font names in the CFADMIN into the "fonts" attribute. This will restrict CFIMAGE to just that font. If you want more than one font type to display, you can list out the fonts in comma delimited format.<br /><br />So here's an example:<br /><br /><cfimage overwrite="Yes"<br />action = "captcha"<br />height = "60"<br />text = "rEadMe"<br />width = "200"<br />fonts = "lucida sans,lucida sans typewriter"<br />fontsize = "30"<br />destination = "assets/images/captcha.jpg"<br />difficulty = "medium"><br /><br />That's it! Good luck!<div class="blogger-post-footer">Fusecast Web Application Development and Web Hosting Services
www.fusecast.com</div>Steve H.http://www.blogger.com/profile/07013507015876931939noreply@blogger.com73tag:blogger.com,1999:blog-3789597170432466058.post-62901172219814448692009-02-26T12:30:00.003-07:002009-02-26T12:33:21.360-07:00Get your GMAIL using Coldfusion's CFPOP<span style="font-weight: bold;">Here is a code sample on how to pull your email off of Gmail.</span><br /><br /><cfset javaSystem = createObject("java", "java.lang.System") /> <br /><cfset jProps = javaSystem.getProperties() /> <br /><cfset jProps.setProperty("mail.pop3.socketFactory.class", "javax.net.ssl.SSLSocketFactory") /> <br /><cfset jProps.setproperty("mail.pop3.port",995) /> <br /><cfset jProps.setProperty("mail.pop3.socketFactory.port", 995) /><br /><br /><cfpop action="GETALL" name="getMail" server="pop.gmail.com" username="[yourUserName]" password="[yourPassword]" port="995" maxrows="20" timeout="90"><br /><br /><cfdump var="#getMail#"><br /><br />Be sure to enable POP on your gmail account<br /><br /><br />Fusecast Web Application Development and Web Hosting Services<br />www.fusecast.com<div class="blogger-post-footer">Fusecast Web Application Development and Web Hosting Services
www.fusecast.com</div>Steve H.http://www.blogger.com/profile/07013507015876931939noreply@blogger.com1tag:blogger.com,1999:blog-3789597170432466058.post-76750612443260950632009-02-23T15:17:00.009-07:002009-02-23T15:56:06.402-07:00I.E. Select Drop Down Cuts Off Using CSS width<span style="font-weight: bold;">The Problem</span><br />While setting up an HTML form I ran into an issue where the select box I was using has an option that was really really long. I set the size of the select box to 166px using CSS styles. Except for I.E., Firefox and every other real browser out there handled it just fine. Since the bulk of my users use I.E., I needed to come up with a hack that would not add a lot of code overhead and be maintainable.<br /><br />Here's what I came up with and it works great!<br /><br /><span style="font-weight: bold;">The Solution</span><br /><br />Original Code<br /><div style="border: 1px solid rgb(204, 204, 204); overflow: auto; width: 100%; height: 200px;"><form name="test"><br /><select name="safetyProgram" id="safetyProgram" style="width:166px;"><br /><option value="0" selected>No safety program</option><br /><option value="1">Cost containment safety program as certified by the state</option><br /><option value="2">Formal written safety program with management oversight including inspections, written documentation, on regular meetings</option><br /><option value="3">Formal written safety program with regular meeting</option><br /><option value="4">Any safety program less than the aformentioned categories</option><br /></select><br /></form><br /></div><br /><span style="font-weight: bold;">Sample</span><br /><form name="test"><br /><select name="safetyProgram" id="safetyProgram" style="width: 166px;"> <option value="0">No safety program</option> <option value="1">Cost containment safety program as certified by the state</option> <option value="2">Formal written safety program with management oversight including inspections, written documentation, on regular meetings</option> <option value="3">Formal written safety program with regular meeting</option> <option value="4">Any safety program less than the aformentioned categories</option></select><br /></form><br /><br />New Code<br /><div style="border: 1px solid rgb(204, 204, 204); overflow: auto; width: 100%; height: 200px;"><form name="test"><br /><select name="safetyProgram" id="safetyProgram" style="width:166px;<strong>position:absolute;z-index:50;</strong>" <strong>onfocus="this.style.width='auto';" onblur="this.style.width='166px';"</strong>><br /><option value="0" selected>No safety program</option><br /><option value="1">Cost containment safety program as certified by the state</option><br /><option value="2">Formal written safety program with management oversight including inspections, written documentation, on regular meetings</option><br /><option value="3">Formal written safety program with regular meeting</option><br /><option value="4">Any safety program less than the aformentioned categories</option><br /></select><br /></form><br /></div><br /><br /><span style="font-weight: bold;">Sample</span><br /><form name="test"><br /><select name="safetyProgram" id="safetyProgram" style="position: absolute; width: 166px; z-index: 50;" onfocus="this.style.width='auto';" onblur="this.style.width='166px';"> <option value="0">No safety program</option> <option value="1">Cost containment safety program as certified by the state</option> <option value="2">Formal written safety program with management oversight including inspections, written documentation, on regular meetings</option> <option value="3">Formal written safety program with regular meeting</option> <option value="4">Any safety program less than the aformentioned categories</option></select><br /></form><br /><span style="font-weight: bold;">Note:</span> <span style="font-style: italic;">If you want to constrict the size the drop down option opens out to, simply change the width parameter in the onFocus from </span><span style="font-weight: bold; font-style: italic;">auto</span><span style="font-style: italic;"> to say </span><span style="font-weight: bold; font-style: italic;">300px</span><span style="font-style: italic;"> or something. Play with it. You'll get the idea.</span><br /><br />And YES, this hack makes the select box float over your other form widgets and text so it doesn't do strange things with the other form elements.<br /><br />Have a go at it! It did the trick for me. I hope it works for you too!<div class="blogger-post-footer">Fusecast Web Application Development and Web Hosting Services
www.fusecast.com</div>Steve H.http://www.blogger.com/profile/07013507015876931939noreply@blogger.com1tag:blogger.com,1999:blog-3789597170432466058.post-86602377490954779182009-01-27T09:45:00.005-07:002009-01-27T09:55:36.768-07:00Binary Object Decoding, Transmitting, Encoding Using ColdfusionAs we start delving into storing binary objects (pdf's, images etc) this post will help you encode, decode and/or transmit the data you are working with. Now I am coming from the perspective of a CF developer so you will need to adapt where need be for environment.<br /><br />We start with a Binary Object (an image).<br /><br />1. Binary Object<br />2. Convert it to base64 for transmitting via xml or another HTTP method<br />---> a. CF method: toBase64(binaryObj)<br />3. Receiver takes the data and encodes it back to a binary object<br />---> a. CF method: toBinary(base64String)<br /><br />Example:<br /><br /><!--- Get a binary object from the database ---><br /><cfquery name="q" datasource="#REQUEST.mysqldsn#"><br />SELECT binaryColumn <!--- This column is a longblob ---><br />FROM mytable<br /></cfquery><br /><br /><!--- View the data from the DB call ---><br /><cfdump var="#q#"><br /><br /><!--- Create a way to view the binary object ---><br /><cfset myImg1 = ImageNew(q.document)><br /><cfimage action="WRITETOBROWSER" source="#myImg1#"><br /><br /><!--- Now convert the binary object from the DB to a base64 string ---><br /><cfset doc = tobase64(q.document)><br /><!--- Display the base64 string ---><br /><cfoutput>#doc#</cfoutput><br /><br /><!--- Convert the base64 string to a binary object ---><br /><cfset doc = toBinary(doc)><br /><br /><!--- Dump the converted base64 to a binary object to view it ---><br /><cfdump var="#doc#"><br /><br /><!--- Create a way to view the binary object ---><br /><cfset myImg2 = ImageNew(doc)><br /><cfimage action="WRITETOBROWSER" source="#myImg2#"><br /><br />Note: Be sure you change your CFADMIN longblob size limits if you need to store large binary objects. Otherwise the data will be truncated.<div class="blogger-post-footer">Fusecast Web Application Development and Web Hosting Services
www.fusecast.com</div>Steve H.http://www.blogger.com/profile/07013507015876931939noreply@blogger.com27tag:blogger.com,1999:blog-3789597170432466058.post-35526748685904781052008-05-14T15:20:00.003-06:002008-05-14T15:39:01.029-06:00Using SPRY and JSON to Get and Display Query Data1. Create a Coldfusion Component (cfc) to gather and package your data (See File 1)<br />2. Create a page to call the cfc and display the returned data. (See File 2)<br /><br />--------------------------------------------<br />File 1. (/components/remote.cfc)<br />--------------------------------------------<br /><cfcomponent output="false"><br /> <br /> <cffunction name="get" access="private" returntype="query" output="yes"><br /> <br /> <cfset var q = ""><br /> <cfquery name="q" datasource="#REQUEST.mysqldsn#"><br /> SELECT *<br /> FROM departments<br /> </cfquery><br /> <br /> <cfreturn q> <br /> </cffunction><br /> <br /> <cffunction name="queryToArray" access="private" returntype="array" output="No"><br /> <cfargument name="queryIn" required="Yes" type="query"><br /> <br /> <cfset var aResult = arrayNew(1)> <br /> <cfset var q = ARGUMENTS.queryIn><br /> <cfset var stData = structNew()><br /> <br /> <cfloop query="q"><br /> <cfset stData = structNew()><br /> <cfloop list="#q.columnList#" index="col"><br /> <cfset stData["#col#"] = Evaluate('q.' & col)><br /> </cfloop><br /> <cfset arrayAppend(aResult,stData)><br /> </cfloop><br /> <br /> <cfreturn aResult><br /> </cffunction><br /> <br /> <cffunction name="getJSON" access="remote" output="yes" returntype="void"><br /> <br /> <cfheader name="Cache-Control" value= "no-cache"><br /> <cfheader name="Expires" value="0"><br /> <cfheader name="Pragma" value="no-cache"><br /> <br /> <!--- Get department data ---><br /> <cfset departments = get()><br /> <br /> <!--- SPRY likes to work with an array of structures rather than a query object since those are unique to Coldfusion. ---><br /> <cfoutput>#serializeJSON(queryToArray(departments))#</cfoutput><br /> </cffunction><br /><br /></cfcomponent><br />--------------------------------------------<br /><br />--------------------------------------------<br />File 2. (mySpryExample.cfm)<br />--------------------------------------------<br /><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br /><cfheader name="Cache-Control" value= "no-cache"><br /><cfheader name="Expires" value="0"><br /><cfheader name="Pragma" value="no-cache"><br /><html><br /><head><br /> <title>SPRY At Work</title><br /> <script src="/SpryAssets/SpryData.js" type="text/javascript"></script><br /> <script src="/SpryAssets/SpryJSONDataSet.js" type="text/javascript"></script><br /> <br /> <script language="JavaScript"><br /> var ds1 = new Spry.Data.JSONDataSet("/components/remote.cfc?method=getJSON",{useCache:false}); <br /> </script><br /></head><br /><br /><body><br /><br /><div spry:region="ds1"><br /><table><br /> <tr><br /> <th spry:sort="DEPARTMENTID" style="cursor:pointer;">Dept ID</th><br /> <th spry:sort="DEPARTMENT" style="cursor:pointer;">Department</th><br /> </tr><br /> <tr spry:repeat="ds1" spry:even="altColor"><br /> <td>{ds1::DEPARTMENTID}</td><br /> <td>{ds1::DEPARTMENT}</td><br /> </tr><br /></table><br /></div><br /><br /></body><br /></html><br />--------------------------------------------<br /><br />--------------------------------------------<br />MySQL Table Construct<br />--------------------------------------------<br />SET FOREIGN_KEY_CHECKS=0;<br />-- ----------------------------<br />-- Table structure for departments<br />-- ----------------------------<br />CREATE TABLE `departments` (<br /> `departmentid` int(11) NOT NULL auto_increment,<br /> `department` varchar(45) default NULL,<br /> PRIMARY KEY (`departmentid`),<br /> UNIQUE KEY `deptid` (`departmentid`)<br />) ENGINE=InnoDB DEFAULT CHARSET=latin1;<br /><br />-- ----------------------------<br />-- Records <br />-- ----------------------------<br />INSERT INTO `departments` VALUES ('1', 'Sales');<br />INSERT INTO `departments` VALUES ('2', 'Accounting');<br />INSERT INTO `departments` VALUES ('3', 'Customer Service');<br />--------------------------------------------<br /><br /><br />This code has been tested on Firefox and I.E.<br /><br /><br />Fusecast Web Application Development and Web Hosting Services<br />www.fusecast.com<div class="blogger-post-footer">Fusecast Web Application Development and Web Hosting Services
www.fusecast.com</div>Steve H.http://www.blogger.com/profile/07013507015876931939noreply@blogger.com0tag:blogger.com,1999:blog-3789597170432466058.post-61185657618051901962008-05-13T17:11:00.003-06:002008-05-13T17:25:27.945-06:00Getting Internet Explorer to Release Dataset CacheGetting I.E. to STOP caching Spry datasets.<br /><br />This help can be applied to all languages (PHP, ASP, Coldfusion) but since I am primarily a Coldfusion developer, I'll demonstrate how I solved this issue using CFML and JavaScript.<br /><br />--------------------------------------------------------------------------<br />File 1. remote.cfc<br />This file basically returns the XML I will call from Spry<br />--------------------------------------------------------------------------<br /><cfcomponent><br /> <cffunction name="qGetData" access="remote" output="No" returntype="any"><br /> <cfargument name="chatid" required="Yes"><br /> <br /> <cfquery name="qGetData" datasource="#DSN#"><br /> SELECT *<br /> FROM chat<br /> WHERE chatid = #ARGUMENTS.chatid#<br /> </cfquery><br /> <br /> <!--- !!!!! IMPORTANT !!!!! ---><br /> <!--- START :: THIS BLOCK OF CODE IS REQUIRED!!! THIS IS WHAT TELLS SPRY TO NOT CACHE THE INCOMING DATA ---><br /> <cfcontent type="text/xml"><!--- I.E. NEEDS THIS ---><br /> <cfheader name="Cache-Control" value= "no-cache"><br /> <cfheader name="Expires" value="0"><br /> <cfheader name="Pragma" value="no-cache"><br /> <!--- END :: THIS BLOCK OF CODE IS REQUIRED!!! THIS IS WHAT TELLS SPRY TO NOT CACHE THE INCOMING DATA ---><br /> <!--- !!!!! IMPORTANT !!!!! ---><br /> <cfset rtrn = ""><br /> <cfxml variable="rtrn"><br /> <chat><br /> <topic><cfoutput>#qGetData.topic#</cfoutput></topic><br /> <cfoutput query="qGetData"><br /> <thread><br /> <date>#DateFormat(qGetData.dtCreated,"m/d/yyyy")#</date><br /> <time>#TimeFormat(qGetData.dtCreated,"h:mm:ss tt")#</time><br /> <firstName>#qGetData.first_name#</firstName><br /> <lastName>#qGetData.last_name#</lastName><br /> <content><![CDATA[#qGetData.content#]]></content><br /> </thread><br /> </cfoutput><br /> </chat><br /> </cfxml><br /> <br /> <cfreturn rtrn><br /> </cffunction><br /></cfcomponent><br />--------------------------------------------------------------------------<br /><br />--------------------------------------------------------------------------<br />File 2. Calling page (chat.cfm)<br />This file uses Spry to get my dataset from File 1.<br />--------------------------------------------------------------------------<br /><br /><cfheader name="Cache-Control" value= "no-cache"><br /><cfheader name="Expires" value="0"><br /><cfheader name="Pragma" value="no-cache"><br /><html><br /> <head><title>My Chat</title></head><br /> <script src="/SpryAssets/xpath.js" type="text/javascript"></script><br /> <script src="/SpryAssets/SpryData.js" type="text/javascript"></script><br /><body><br /><cfoutput><script language="JavaScript"><br /> //!!!!! IMPORTANT !!!!!<br /> //This variable is appended to the query string to ensure that a cached dataset isn't returned.<br /> var d = new Date().valueOf();<br /> //!!!!! IMPORTANT !!!!!<br /> threads = new Spry.Data.XMLDataSet("/components/remote.cfc?method=qGetData&chatid=#URL.chatid#&cacheBuster=" + d.toString(), //!!!!! IMPORTANT !!!!!<br /> "chat/thread",<br /> {<br /> distinctOnLoad:true,<br /> loadInterval:2000,<br /> useCache:false //this ONLY works in Firefox.<br /> }<br /> );<br /> //The content column needs to be defined as HTML. What a bugger this was to figure out!<br /> threads.setColumnType("content", "html");<br /></script></cfoutput><br /><br /><!--- Output your data! ---><br /><div spry:region="threads"><br /> <div spry:repeat="threads"><br /> {threads::firstName} says: {threads::time}<br><br /> <div>{threads::content}</div><br /> </div><br /></div><br /><br /></body><br /></html><br />--------------------------------------------------------------------------<br /><br />That should do it. EVERYWHERE you see !!!!! IMPORTANT !!!!! you must be sure to do.<br /><br />Good luck!<br /><br />Steve Holland<br />Fusecast<div class="blogger-post-footer">Fusecast Web Application Development and Web Hosting Services
www.fusecast.com</div>Steve H.http://www.blogger.com/profile/07013507015876931939noreply@blogger.com4tag:blogger.com,1999:blog-3789597170432466058.post-46844262606072329142008-03-25T11:51:00.005-06:002008-03-25T12:00:02.932-06:00Set All Form Fields In All Forms To Disabled/*----------------------------------------------------<br />This code disables ALL fields in all forms on a screen.<br />USAGE:<br /><script language="JavaScript"><br /> disableForms()<br /></script><br />----------------------------------------------------*/<br />function disableForms(){<br /> //Loop over the forms<br /> for(i=0;i<document.forms.length;i++){<br /> //Loop over the form elements<br /> for(j=0;j>document.forms[i].elements.length;j++){<br /> //alert(document.forms[i].elements[j].name);<br /> document.forms[i].elements[j].disabled = "true";<br /> }<br /> }<br /> }<div class="blogger-post-footer">Fusecast Web Application Development and Web Hosting Services
www.fusecast.com</div>Steve H.http://www.blogger.com/profile/07013507015876931939noreply@blogger.com0tag:blogger.com,1999:blog-3789597170432466058.post-6602611854363454372008-02-08T16:41:00.000-07:002008-02-08T16:51:00.414-07:00FCKEditor and Stylesheets<span style="font-family:georgia;">Getting FCKEditor to work with your stylesheets is a trick because documentation on how to do it is not very good. You get the basics here and there but finding docs that tell you how from A-Z just doesn't exists.... till now. Here's how I did it.</span><br /><br />This is what I figured out for FCKEditor to get it to use custom stylesheets...<br /><br />1. Open up /fckeditor/fckconfig.js<br />1a. Edit the following variable:<br /><br />FCKConfig.BaseHref = 'http://www.yourDomain.com/';<br />FCKConfig.EditorAreaCSS = '/style.css' ;<br /><br />Save and close<br /><br />2. Open up /fckeditor/fckstyles.xml<br />2a. Define your styles:<br />E.g.<br /><Style name="heading1" element="span"><br /> <Attribute name="class" value="heading1" /><br /></Style><br /><Style name="heading2" element="span"><br /> <Attribute name="class" value="heading2" /><br /></Style><br /><Style name="heading3" element="span"><br /> <Attribute name="class" value="heading3" /><br /></Style><br /><br />(Note: this XML must coincide with your CSS. If you have a Style called "myHeader", then you would have XML that would look like this)<br /><br /><Style name="myHeader" element="span"><br /> <Attribute name="class" value="myHeader" /><br /></Style><br /><br />Save and close.<br /><br />The Jist.<br /><br />The first operation pulls in the entire CSS stylesheet your using.<br />The second operation allows you to show in the style drop down what styles to be used by the user. Not all of the styles in the CSS file are seen or needed by the user normally. This is a great way to separate them but allow them to use their defined styles.<div class="blogger-post-footer">Fusecast Web Application Development and Web Hosting Services
www.fusecast.com</div>Steve H.http://www.blogger.com/profile/07013507015876931939noreply@blogger.com1tag:blogger.com,1999:blog-3789597170432466058.post-87617318279574233712007-12-04T07:56:00.000-07:002007-12-04T08:05:11.697-07:00Time Machine HangsI have found an issue with Time Machine on Mac Leopard 10.5.1 where it hangs and causes all sorts of grief. I found that it does this when I have Parallels open.<br /><br />Here is how I fixed it. (Before we start, be sure Parallels is off)<br /><br />1. Turn off Time Machine.<br />2. Open up Time Machine Preferences.<br />3. Click the "Options" button.<br />4. At the bottom left is a button with a "+" sign. Click it. (We're going to add an exception to TM)<br />5. Navigate to /users/[user]/Documents<br />6. Select the "Parallels" directory and click the "Exclude" button.<br />(You have just excluded Time Machine from backing up your parallels directory. When Parallels is open, the contents of this directory are constantly changing. This drives Time Machine crazy for some reason.)<br />7. Turn on Time Machine.<br /><br />You're done. Good luck.<div class="blogger-post-footer">Fusecast Web Application Development and Web Hosting Services
www.fusecast.com</div>Steve H.http://www.blogger.com/profile/07013507015876931939noreply@blogger.com0tag:blogger.com,1999:blog-3789597170432466058.post-24971681176226737232007-08-21T12:31:00.000-06:002007-08-25T15:07:29.086-06:00Verity Collection Creation ErrorWhen creating Verity collections, you may get this error from time to time.<br /><br /><span style="font-weight: bold;">ERROR</span><br />An error occurred while performing an operation in the Search Engine library.<br />Error opening the collection: com.verity.organize.WorkSpaceException: Path not found [VdkError_PathNotFound]. (-104)<br /><br /><span style="font-weight: bold;">ANOTHER RELATED ERROR</span><br />If you go into your CFADMIN and click on Verity, you may get the following message.<br /><br /><div style="text-align: center;"><span style="font-style: italic;" class="error"> Unable to retrieve collections from the Search Service.</span><br /><span style="font-style: italic;" class="error"> Please verify that the ColdFusion Search Server is installed and running.</span><br /></div><br />I found that the problem was in the creation of the <span style="font-style: italic;">"bookclub"</span> collection on new CF installs. However, if you have a collection gone wild, this is how you can fix it.<br /><br /><span style="font-weight: bold;">FIX TO BOTH ERRORS</span><br /><br /><span style="font-weight: bold;">1. Delete the collection(s) definition(s) via code or from the verity admin in CFADMIN if you can. If you can't see the collections do it via the code below.</span><br />VERITY COLLECTIONS BEFORE PURGE<br /><cfdirectory action="LIST" directory="[CF INSTALL]/verity/collections" name="GetCols"><cfdump var="#GetCols#"><cfif><cfoutput query="GetCols"><cfdirectory action="LIST" directory="[CF INSTALL]/verity/collections" name="GetCols"><cfdirectory action="LIST" directory="[CFINSTALL]/verity/collections" name="GetCols"><br /><cfdump var="#GetCols#"><br /><br><br /><br />DELETE ALL COLLECTIONS<br /><cfoutput query="GetCols"><br /><cfif GetCols.name DOES NOT CONTAIN "."><br /><cfcollection action="DELETE" collection="#GetCols.name#" path="[</cfdirectory></cfoutput></cfif></cfdump></cfdirectory>CFINSTALL<cfdirectory action="LIST" directory="[CF INSTALL]/verity/collections" name="GetCols"><cfdump var="#GetCols#"><cfif><cfoutput query="GetCols"><cfdirectory action="LIST" directory="[CF INSTALL]/verity/collections" name="GetCols">]/verity/collections/#GetCols.name#"><br />"#GetCols.name#" collection removed<br><br><br /></cfif><br /></cfoutput><br /><br /></cfdirectory></cfoutput></cfif></cfdump></cfdirectory>VERITY COLLECTIONS AFTERPURGE<br /><cfdirectory action="LIST" directory="[CF INSTALL]/verity/collections" name="GetCols"><cfdump var="#GetCols#"><cfif><cfoutput query="GetCols"><cfdirectory action="LIST" directory="[CF INSTALL]/verity/collections" name="GetCols"> <cfdirectory action="LIST" directory="[CFINSTALL]/verity/collections" name="GetCols"><br /><cfdump var="#GetCols#"></cfdirectory></cfoutput></cfif></cfdump></cfdirectory><cfdirectory action="LIST" directory="[CF INSTALL]/verity/collections" name="GetCols"><cfdump var="#GetCols#"><cfif><cfoutput query="GetCols"><cfdirectory action="LIST" directory="[CF INSTALL]/verity/collections" name="GetCols"><cfdump var="#GetCols#"></cfdump><br /><br /><span style="font-weight: bold;">2. Go to:</span><br /><span style="font-size:85%;">[CFINSTALL]/verity/Data/services/ColdFusionK2_indexserver1/ws</span><br /><br />(The "ws" directory acts as a work space during collection creation)<br /><br /><span style="font-weight: bold;">3. Run: [rm –rf *] to remove everything in the ws directory.</span><br /><br /><span style="font-weight: bold;">4. Run: [CFINSTALL]/bin/cfmxsearch restart</span><br /><br /><span style="font-weight: bold;">5. Re-create the collection in the CFADMIN or using CFCOLLECTION.</span></cfdirectory></cfoutput></cfif></cfdump></cfdirectory><div class="blogger-post-footer">Fusecast Web Application Development and Web Hosting Services
www.fusecast.com</div>Steve H.http://www.blogger.com/profile/07013507015876931939noreply@blogger.com0tag:blogger.com,1999:blog-3789597170432466058.post-11311552232525329232007-04-03T12:11:00.000-06:002007-04-06T12:59:20.211-06:00MySQL and Coldfusion Isolation Types<span style="font-family: georgia;font-size:85%;" >I was working a locking and speed problem with our MySQL Servers today and found something interesting you may want to have a look at.<br /><br />MySQL defaults its tables to MyISAM. In order to create Foreign Key relationships, the tables must be changed to InnoDB. The problem with InnoDB is that by default the isolation level for the tables are "REPEATABLE-READ".<br /><br />In reading the documentation for CF on cftransaction tags, adobe says that "REPEATABLE-READ" is the same as read-committed, except that rows in the recordset are exclusively locked until the transaction completes. Due to high overhead, Macromedia does not recommend this isolation level for normal database access..<br /><br />The recommended isolation level is "READ-COMMITTED".<br /><br />Now you can go through ever query statement and encase each with a cftransaction tag specifying the isolation type OR you can set it as the general isolation type for MySQL.<br /><br />This is how to change the default isolation level for MySQL. It's simple and fast and requires a quick MySQL restart.<br /><br />1. Run the following SQL to see what the default Isolation level was for the DB.<br />SELECT @@global.tx_isolation;<br />SELECT @@tx_isolation;<br /><br />If you got back anything but "READ-COMMITTED", continue on to step 2.<br /><br />2. I created a text file called my.cnf.<br />------------------------------<br />File contents<br />=====================<br />[mysqld]<br />transaction-isolation = READ-COMMITTED<br />=====================<br />Note: Do not use the dashes or "File contents". Just the portion between the "=" signs. If you have a my.cnf, just add "transaction-isolation = READ-COMMITTED" to it.<br /><br />3. Uploaded the file (my.cnf) to /etc/ on the server (Linux)<br />4. Restart MySQL /etc/init.d/mysql restart<br />5. Re-run the following SQL<br />SELECT @@global.tx_isolation ;<br />SELECT @@tx_isolation;<br /><br />You should get back "READ-COMMITTED"<br /><br />Boom! Game on! Now your servers will be running what Adobe recommends for CF.<br /><br />When I did this, immediately I saw huge performance gains from my production box!<br /><br />Hope this helps!<br /><br />Steve H.<br />www.fusecast.com<br />Web hosting, design and development services.</span><div class="blogger-post-footer">Fusecast Web Application Development and Web Hosting Services
www.fusecast.com</div>Steve H.http://www.blogger.com/profile/07013507015876931939noreply@blogger.com0tag:blogger.com,1999:blog-3789597170432466058.post-12107473468192372932007-04-03T11:29:00.000-06:002007-04-06T15:50:12.287-06:00MySQL inexplicably pegs with Coldfusion<span style="font-size:85%;"><span style="font-weight: bold;font-family:georgia;" >SYMPTOMS</span><br /><span style="font-family:georgia;">Using Coldfusion, MySQL uses 100% CPU on consistant intervals. Most likely around 1 hour and 7 minutes.</span><br /><span style="font-family:georgia;">Not caused by too many connections or memory limits.</span><br /><br /><span style="font-weight: bold;font-family:georgia;" >THE PROBLEM</span><br /><span style="font-family:georgia;">Coldfusion’s administrator runs automatic processes via a method called CFHTTP. It is used to invoke Scheduled Tasks and other things like the client stores purging. In this case, client stores purge settings are by default set to start removing client variables older than 90 days. Once it detects that it has been 90 days, every hour and seven minutes it will execute a call via CFHTTP to purge data from MySQL (or your DBMS).</span><br /><br />This process works great unless the URL being called by CFHTTP is a secure address (https) and the server owning the URL has a self signed certificate or the certificate of authority does not exist in the cacerts file in CFMX. In order to connect to SSL enabled resources via tags like CFHTTP, CFINVOKE, and CFLDAP, you must import SSL certificates into the JVM keystore used by the JVM under ColdFusion MX.<br /><br /><span style="font-family:georgia;">Because my server has a self signed SSL Cert, CFADMIN's call to purge client stores via CFHTTP was failing. This is where I was seeing MySQL run up the CPU. CFADMIN was executing the CFHTTP method that ran a MySQL data purge routine on the CLIENT VAR tables CDATA and CGLOBAL. Because my local server's SSL cert was not identified to Coldfusion, it was erroring out but not timing out the connections to MySQL.</span><br /><br /><span style="font-weight: bold;font-family:georgia;" >PROPOSED SOLUTIONS</span><br /><span style="font-family:georgia;">There are four known ways to fix this problem.<br /><br /></span><span style="font-family:georgia;">1. Configure SSL for CFADMIN.</span><br /><a href="http://www.talkingtree.com/blog/index.cfm?mode=entry&entry=25AA75A4-45A6-2844-7CA3EECD842DB576">Click here to see how</a><br /><span style="font-family:georgia;">2. Remove CFADMIN from under https.</span><br /><span style="font-family:georgia;">3. Turn off all automatic processing. That includes turning off clients stores. <span style="font-size:78%;">(See below)</span><br />4. Check for SSL Certificate install errors on the server being called. <span style="font-size:78%;">(Most common problem)<br /></span></span><br /><span style="font-family:georgia;">Stopping Client Variable Purging</span><br /><span style="font-family:georgia;">Do:</span><br /><span style="font-family:georgia;">1. Client Variables</span><br /><span style="font-family:georgia;">2. Click on the datasource you are using to store client vars in</span><br /><span style="font-family:georgia;">3. Uncheck the box that says "Purge data for clients that remain unvisited for [box] days."<br /><br />As I get more information, I will post it or modify what I have previously written.<br /><br />Good luck!<br /><br />Steve H.<br /><br />www.fusecast.com<br />Web hosting, design and development services.<br /></span><br /></span><div class="blogger-post-footer">Fusecast Web Application Development and Web Hosting Services
www.fusecast.com</div>Steve H.http://www.blogger.com/profile/07013507015876931939noreply@blogger.com4