<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>Rob Brooks-Bilson&apos;s Blog - Bug</title>
			<link>http://www.brooks-bilson.com/blogs/rob/index.cfm</link>
			<description>A blog for ColdFusion and other topics by Rob Brooks-Bilson, author of the O&apos;Reilly book Programming ColdFusion MX</description>
			<language>en-us</language>
			<pubDate>Thu, 09 Sep 2010 11:56:36 -0400</pubDate>
			<lastBuildDate>Mon, 09 Aug 2010 15:50:00 -0400</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>rbils@amkor.com</managingEditor>
			<webMaster>rbils@amkor.com</webMaster>
			
			
			
			
			
			<item>
				<title>Issue  with Ehcache and ColdFusion Query Objects</title>
				<link>http://www.brooks-bilson.com/blogs/rob/index.cfm/2010/8/9/Bug-with-Ehcache-and-ColdFusion-Query-Objects</link>
				<description>
				
				I submitted a bug for this but the system seems to have swallowed it
up without giving me the bug number (probably because I submitted as
cf 9.0.1).

I&apos;ve found &lt;strike&gt;what I consider to be a serious bug&lt;/strike&gt; an issue with ColdFusion&apos;s
ehache implementation and query objects that may bite you if you&apos;re not aware of how it works.  If I take a query object and stick it in cache, then perform an operation on the original query
object such as adding a column or performing certain query of query
operations, ColdFusion is treating the query object that&apos;s in cache as
if it were a copy by reference to the original query object.  That is,
if I make a change to the original query object, ColdFusion is also
applying the change to the version that&apos;s in cache.

&lt;strike&gt;As far as I&apos;m concerned, cache represents a boundary that ColdFusion
should not implicitly cross.&lt;/strike&gt; With most caching systems I&apos;ve worked with in the past (such as memcached), the cache always acted as a dumb key/value store.  Unless I perform an explicit cachePut(), I wouldn&apos;t expect that CF would update values in the cache.  Here&apos;s
two code snippets that reproduces the case. The first uses the
cfartgallery data source:

&lt;code&gt;
&lt;!--- Demo code to show that ColdFusion&apos;s passig query values by reference is crossing boundaries and updating a query stored in cache ---&gt;
&lt;cfquery name=&quot;getArtists&quot; datasource=&quot;cfartgallery&quot;&gt;
select *
from artists
&lt;/cfquery&gt;

&lt;!--- dump the original query ---&gt;
&lt;cfdump var=&quot;#getArtists#&quot;&gt;

&lt;!--- put the query in cache ---&gt;
&lt;cfset cachePut(&quot;artistsQuery&quot;, getArtists,
&apos;#createTimeSpan(0,0,5,0)#&apos;, &apos;#createTimeSpan(0,0,5,0)#&apos;)&gt;

&lt;!--- add a column to the query ---&gt;
&lt;cfset queryAddColumn(getArtists,&quot;newColumn&quot;,arrayNew(1))&gt;
&lt;cfdump var=&quot;#getArtists#&quot;&gt;

&lt;!--- clear the query ---&gt;
&lt;cfset getArtists=&quot;&quot;&gt;
&lt;cfdump var=&quot;#getArtists#&quot;&gt;

&lt;!--- get the query from cache again - note that the added column is
there! ---&gt;
&lt;cfdump var=&quot;#cacheGet(&quot;artistsQuery&quot;)#&quot;&gt;
&lt;/code&gt;

The second example shows how this can be done with a query of a query,
based on a different bug Ray found previously (see
&lt;a href=&quot;http://www.coldfusionjedi.com/index.cfm/2009/8/28/Another-example-of-the-QofQ-Bug&quot;&gt;http://www.coldfusionjedi.com/index.cfm/2009/8/28/Another-example-of-the-QofQ-Bug&lt;/a&gt;).
In this sample, note that the date gets reformatted by the query of a
query and both the original query and the cached version get updated:

&lt;code&gt;
&lt;cfset mydata = queryNew(&quot;mydate, rannum&quot;)&gt;

  &lt;cfloop index=&quot;loop1&quot; from=&quot;1&quot; to=&quot;5&quot;&gt;
   &lt;cfset newrow = queryaddrow(mydata, 1)&gt;
   &lt;cfset temp = querysetcell(mydata, &quot;mydate&quot;, #dateformat(now()-
loop1,&quot;dd-mmm-yy&quot;)#, #loop1#)&gt;
   &lt;cfset temp = querysetcell(mydata, &quot;rannum&quot;, 55.65, #loop1#)&gt;
  &lt;/cfloop&gt;

&lt;cfdump var=&quot;#mydata#&quot;&gt;

&lt;cfset cachePut(&quot;myQuery&quot;, myData, &apos;#createTimeSpan(0,0,5,0)#&apos;,
&apos;#createTimeSpan(0,0,5,0)#&apos;)&gt;

&lt;cfdump var=&quot;#mydata#&quot;&gt;

&lt;cfquery dbtype=&quot;query&quot; name=&quot;query4graph&quot;&gt;
  select mydate, rannum from mydata
  &lt;/cfquery&gt;

 &lt;cfdump var=&quot;#query4graph#&quot;&gt;

 &lt;cfdump var=&quot;#cacheGet(&quot;myQuery&quot;)#&quot;&gt;
&lt;/code&gt;

The work around for this problem is to use the duplicate()
function to make a clone of the query object before doing the
cachePut(). Although this works, there are other potential
consequences from having two copies of the query around, so be careful.

&lt;strong&gt;Update: &lt;/strong&gt; It looks like this is actually expected behavior in Ehcache.  Unfortunately, it&apos;s not documented in the ColdFusion documentation anywhere, but Ehcache actually has two configurable parameters (as of v. 2.10) called copyOnRead and copyOnWrite that determine whether values returned from the cache are by reference or copies of the original values.  By default, items are returned by reference.  Unfortunately we can&apos;t take advantage of these parameters right now as CF 9.0.1 implements Ehcache 2.0.  

I can live with this, but it&apos;s not what I expected as I&apos;ve always viewed Ehcache as a &quot;dumb&quot; key-value store and certainly didn&apos;t expect this behavior.  Even if ColdFusion was running v 2.10 of Ehcache, it&apos;s still not something we could easily configure.  Since ColdFusion currently doesn&apos;t have a cacheNew() function for creating new user-defined cache regions, the only way to turn this functionality off would be to hard-code your cache configuration in your ehcache.xml file for each user-defined region where you want to disable copyOnRead and copyOnWrite.
				
				</description>
						
				
				<category>Bug</category>				
				
				<category>Caching</category>				
				
				<category>ColdFusion 9</category>				
				
				<category>Ehcache</category>				
				
				<pubDate>Mon, 09 Aug 2010 15:50:00 -0400</pubDate>
				<guid>http://www.brooks-bilson.com/blogs/rob/index.cfm/2010/8/9/Bug-with-Ehcache-and-ColdFusion-Query-Objects</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Fix for Vista&apos;s: The User Profile Service service failed the logon. User profile cannot be loaded</title>
				<link>http://www.brooks-bilson.com/blogs/rob/index.cfm/2009/1/5/Fix-for-Vistas-The-User-Profile-Service-service-failed-the-logon-User-profile-cannot-be-loaded</link>
				<description>
				
				Back in November I finally took the plunge and upgraded my home computer to the 64bit version of Windows Vista Ultimate via a clean install.  One thing I did immediately after the install was to move the \users directory from c:\users to f:\users. I did this for two reasons. First, the drive Vista was installed on was only 250GB and I could see running out of room pretty quickly given all of the documents, pictures, videos, etc. I had on the system. The second reason for the move is that I wanted to separate my data from the operating system as much as possible to make upgrades and backups easier to manage.  

Unfortunately, there&apos;s no easy way in Vista to relocate the \users directory. If you know what you&apos;re doing you can change the location during install by using an unattended install, but this can be very complicated to do and is something that&apos;s beyond most casual users.  In the end I settled on moving all of c:\users over to f:\users and using symbolic links to point from c:\users to f:\users. That way programs could continue to reference c:\users but the operating system would be smart enough to know and forward all requests to f:\users.  Following the directions &lt;a href=&quot;http://rogerhendriks.blogspot.com/2007/09/moving-vista-users-directory.html&quot;&gt;here&lt;/a&gt; I was able to move the directories and files and create the required symbolic links.
Everything worked well until I got back from vacation last week and my wife tried to login to her account to pay some bills and was greeted by the following error: &quot;The User Profile Service service failed the logon. User profile cannot be loaded.&quot;  This seemed odd because she had successfully logged into her account only a few weeks ago.  

Searching the web for answers turned up &lt;a href=&quot;http://www.vistax64.com/tutorials/130095-user-profile-service-failed-logon-user-profile-cannot-loaded-36.html&quot;&gt;this site&lt;/a&gt;, which nearly everyone else experiencing the problem linked to.  

My problem boiled down to this.  I could log in to vista using my (Admin) account and create as many new users as I wanted to via the User Management tools in the control panel.  In the User Management tool, I could see each and every one of the new accounts.  When I booted up the system or choose to Switch Users, all of the newly created accounts showed up on the log in screen. However, any attempt to log in using any of those accounts resulted in the same &quot;The User Profile Service service failed the logon. User profile cannot be loaded&quot; error.  

The recommended solution involved making changes to a specific registry entry that had become corrupted and contained a backup entry.  After looking through the recommended solutions, it was obvious to me that my problem was a little different from the majority of users posting to the site.   In my case, there was no corrupt registry entry and no backup key to work with.  In fact, there were no registry entries for any user accounts other than my working Admin account.  I also didn&apos;t have a system restore point that went back far enough before I was convinced that the problem had started. From what I could tell, the problem started after an automated Windows update had been applied.  The recommendation made to me and others on the forums with the same problem was to reinstall Vista, something I wasn&apos;t keen on doing.

At this point, it seemed to me that something must be wrong  with the initial creation of a user&apos;s profile the first time they log on to Vista. When you create a new user account from the User Manager, Vista doesn&apos;t actually create the user&apos;s directories until their first log in.  When a user logs in for the first time, Vista uses the contents of c:\users\default as a template for the directory/file structure for that user.  In the case of the &quot;The User Profile Service service failed the logon. User profile cannot be loaded&quot;, I was getting the new user directory (and associated registry entry) was never getting created.

A little more digging through the various Windows log files turned up something interesting.  In addition to all of the errors stemming from the user not being able to log in successfully was a warning that a particular filename/extension was to long to be copied.  Here it turns out that Vista ran into a problem while trying to copy the default profile during the account creation/log in process.  Specifically there are two directories preventing the default profile from being created. The first is:

&lt;strong&gt;c:\users\default\AppData\Local\Application Data&lt;/strong&gt;

As you can see in the following screen shot, the root Application Data folder contains a lot of recursively added \Application Data folders.  My best guess is that something went wrong during one of the Windows update processes, resulting in all of the extra recursive \Application Data directories.  From the research I&apos;ve done this doesn&apos;t appear to be limited to a single specific Windows update as people have reported the problem as far back as 2007.

&lt;a href=&quot;http://www.flickr.com/photos/brooks-bilson/3171977476/&quot; title=&quot;Screen1 by Styggiti, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3457/3171977476_8ec6b2f806.jpg&quot; width=&quot;500&quot; height=&quot;403&quot; alt=&quot;Screen1&quot; /&gt;&lt;/a&gt;

The second directory you&apos;ll need to take a look at is:

&lt;strong&gt;C:\users\default\Local Settings\Application Data&lt;/strong&gt;

Again, if you look in this directory you should find several more levels of \Application Data appended to the top level \Application Data:

&lt;a href=&quot;http://www.flickr.com/photos/brooks-bilson/3171148301/&quot; title=&quot;Screen2 by Styggiti, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3259/3171148301_a5acc48ec7.jpg&quot; width=&quot;500&quot; height=&quot;403&quot; alt=&quot;Screen2&quot; /&gt;&lt;/a&gt;

In both cases, what you&apos;ll need to do is to delete all of the additional occurrences of \Application Data below the root level. Once you&apos;ve done this any user experiencing the &quot;The User Profile Service service failed the logon. User profile cannot be loaded&quot; error should be able to login.
				
				</description>
						
				
				<category>Vista</category>				
				
				<category>Bug</category>				
				
				<category>Windows</category>				
				
				<pubDate>Mon, 05 Jan 2009 15:17:00 -0400</pubDate>
				<guid>http://www.brooks-bilson.com/blogs/rob/index.cfm/2009/1/5/Fix-for-Vistas-The-User-Profile-Service-service-failed-the-logon-User-profile-cannot-be-loaded</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>ColdFusion 8 Causing BSOD on Install For You?  I Have a Solution</title>
				<link>http://www.brooks-bilson.com/blogs/rob/index.cfm/2007/9/25/ColdFusion-8-Causing-BSOD-on-Install-For-You--I-Have-a-Solution</link>
				<description>
				
				I&apos;ve been having problems getting ColdFusion 8 installed on my laptop for months now.  No matter how I tried installing it (stand alone, multi-server, j2ee), it caused my computer to Blue Screen during the install process.  Everything would go ok right up until I launched the ColdFusion Administrator to complete the install process.  After launching the CF Administrator, the computer would continue on for between 1 and 30 seconds before it would blue screen with a BAD_POOL_HEADER error.

I know others are having the problem as well as a Google search turns up several others with the problem but no satisfactory solution.

After a lot of off and on troubleshooting, I finally had a chance to sit down over the past two days and have figured out what the problem is and have come up with a workaround.  It turns out that the issue is the JVM.  More specifically, Java 6 (and on my machine Java 5 as well) causes the problem.  I can cause the BSOD with Java 6 using both ColdFusion 8 and JBoss (without ColdFusion).  

Since the ColdFusion 8 installer lays down the 1.6.0_01 jvm, you need a way to install ColdFusion 8 with an earlier jvm.  Here&apos;s the workaround I&apos;ve come up with.  In my case, I chose to use the 1.4.2_14 version of the jdk:

&lt;ol&gt;
&lt;li&gt;Go through the entire CF install (doesn&apos;t matter which server method).  However, don&apos;t launch the CF Administrator to complete the install.  If you do this, you&apos;ll BSOD.&lt;/li&gt;
&lt;li&gt;Download an older version of the Sun JDK.  I happened to test with 1.4.2_14, which seems to be working for me.  When I get time, I may test with earlier versions of 1.5, but the latest 1.5 still caused BSOD for me.&lt;/li&gt;
&lt;li&gt;Install the JDK.  you may have to reboot.&lt;/li&gt;
&lt;li&gt;Open the jvm.config file (c:\jrun4\bin) and change java.home to point to the JDK you just installed.  This will tell cf to use that jvm instead of the 1.6.0_01 version that installs with cf 8.&lt;/li&gt;
&lt;li&gt;Start all CF services.  If any are already started, restart them.&lt;/li&gt;
&lt;li&gt;Open the CF Admin to complete the install process.  It should complete without error, and without any BSOD.&lt;/li&gt;
&lt;/ol&gt;

At this point, you should be good to go.  &lt;strike&gt;I should point out that the BSOD problem is most likely a problem with Java 6 and either my video card, or my NIC.  I have an IBM T60 with an Intel Nic.  Others in my office have the same laptop and nic, but aren&apos;t having the BSOD problem.  They do, however have a different video card than I do (I have an ATI Mobility Radeon X1400).  IBM OEM&apos;s the card in my case, so any resolution is going to have to come from them on my end.  I have no idea if they will ever resolve the issue, so all I can do is continue to test new JVM versions with my setup as they come out to see if the problem has been resolved.&lt;/strike&gt;
				
				</description>
						
				
				<category>Bug</category>				
				
				<category>JVM</category>				
				
				<category>ColdFusion 8</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Tue, 25 Sep 2007 23:03:00 -0400</pubDate>
				<guid>http://www.brooks-bilson.com/blogs/rob/index.cfm/2007/9/25/ColdFusion-8-Causing-BSOD-on-Install-For-You--I-Have-a-Solution</guid>
				
			</item>
			
		 	
			</channel></rss>