<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BarneyBlog &#187; railo</title>
	<atom:link href="http://www.barneyb.com/barneyblog/category/railo/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.barneyb.com/barneyblog</link>
	<description>Thoughts, rants, and even some code from the mind of Barney Boisvert.</description>
	<lastBuildDate>Mon, 02 Mar 2020 13:20:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Railo And AOP Transactions</title>
		<link>https://www.barneyb.com/barneyblog/2010/07/23/railo-and-aop-transactions/</link>
		<comments>https://www.barneyb.com/barneyblog/2010/07/23/railo-and-aop-transactions/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 19:03:15 +0000</pubDate>
		<dc:creator>barneyb</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[railo]]></category>

		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1555</guid>
		<description><![CDATA[If you're reading this, chances are good you're a software developer.Â  And that means you never touch the DB outside a transaction, right?Â  Of course, right.
Most of the time, transactions are a bit of a bear because their use is orthagonal to your business tasks.Â  To put that another way, business operations flow vertically from [...]]]></description>
			<content:encoded><![CDATA[<p>If you're reading this, chances are good you're a software developer.Â  And that means you never touch the DB outside a transaction, right?Â  Of course, right.</p>
<p>Most of the time, transactions are a bit of a bear because their use is orthagonal to your business tasks.Â  To put that another way, business operations flow vertically from UI to backend to UI, and the various operations in your app typically flow mostly in separate parallel channels.Â  Transactions go <em>across</em> your application's structure, needing to be uniformly applied to all those operations, but being independent of all of them.Â  The "right" term for this is a "cross-cutting concern."</p>
<p>Fortunately, there are a pile of people in this world who are <em>way</em> smarter than I, and they've come up with <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">Aspect Oriented Programming</a> as a way to deal with these cross-cutting concerns.Â  The typical example shown is with logging, but transaction management is rather more useful, I think, isn't any more complicated, and is also more specific to AOP (whereas logging could be done with event-driven programming as well).Â  I'm not going to go into AOP, but if you're not using it, you should spend the time to learn a bit about it.Â  Really.</p>
<p>So the idea is to leverage AOP to automatically wrap your business methods with transactions.Â  In the CFML world, that means <a href="http://www.coldspringframework.org/">ColdSpring</a> and its AOP support (which is modelled after Java's Spring framework).Â  Unfortunately, that's the easy part.Â  Since CFML servers abstract away DB connections (behind DSNs), it's hard to get ahold of the proper context to do the transaction demarcation correctly from your application code.Â  Somehow you have to know what the engine is doing behind the scenes so you can start/stop transactions at the right places.</p>
<p>When I wrote <a href="http://www.barneyb.com/barneyblog/projects/transaction-advice/">transactionadvice.cfc</a> many years ago, I used a psuedo-ThreadLocal for tracking transactional method depth.Â  That way it can apply transactions at the top level, but skip them lower (nested) levels.Â  It works, but it doesn't handle multithreaded requests (i.e., using CFTHREAD) correctly, so it's far from ideal.Â  Using a real ThreadLocal would be better, but it requires Java or Groovy, and that's a dependency I don't want to require.Â  But for the majority of cases, it works fine.</p>
<p>Today, however, I discovered that Railo has this method:</p>
<pre>getPageContext().getDataSourceManager().isAutoCommit()</pre>
<p>It will tell you whether you're currently in autocommit (non-transaction) mode.Â  With this direct check of the transactional status, all the issues simply vanish, and the advice can be whittled down to this:</p>
<pre>&lt;cfcomponent extends="coldspring.aop.MethodInterceptor"&gt;

  &lt;cffunction name="invokeMethod" access="public" output="false" returntype="any"&gt;
    &lt;cfargument name="methodInvocation" type="coldspring.aop.MethodInvocation" required="true" /&gt;
    &lt;cfif getPageContext().getDataSourceManager().isAutoCommit()&gt;
      &lt;cftransaction&gt;
        &lt;cfreturn methodInvocation.proceed() /&gt;
      &lt;/cftransaction&gt;
    &lt;cfelse&gt;
      &lt;cfreturn methodInvocation.proceed() /&gt;
    &lt;/cfif&gt;
  &lt;/cffunction&gt;

&lt;/cfcomponent&gt;</pre>
<p>Copiously excellent, if you ask me.Â  About the only thing that would make it better is if CFML grew a isAutoCommit() or isInTransaction() method so you don't have to dig into the underlying Java bits in an engine-specific way.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.barneyb.com/barneyblog/2010/07/23/railo-and-aop-transactions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tokenless location() Without Parameters</title>
		<link>https://www.barneyb.com/barneyblog/2010/07/08/tokenless-location-without-parameters/</link>
		<comments>https://www.barneyb.com/barneyblog/2010/07/08/tokenless-location-without-parameters/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 17:46:36 +0000</pubDate>
		<dc:creator>barneyb</dc:creator>
				<category><![CDATA[railo]]></category>

		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1551</guid>
		<description><![CDATA[Both Railo and ColdFusion have added a builtin 'location' function in recent versions, and like their CFLOCATION counterpart, the default behaviour is to append the jsessionid/CFIDE/CFTOKEN tuple to the URL when redirecting.Â  I find this rather annoying, and it's even worse since FB3lite has a 'location' function which defaults it to false.Â  Unfortunately there isn't [...]]]></description>
			<content:encoded><![CDATA[<p>Both Railo and ColdFusion have added a builtin 'location' function in recent versions, and like their CFLOCATION counterpart, the default behaviour is to append the jsessionid/CFIDE/CFTOKEN tuple to the URL when redirecting.Â  I find this rather annoying, and it's even worse since FB3lite has a 'location' function which defaults it to false.Â  Unfortunately there isn't a way to use the FB3lite UDF in place of the engine built-in, so when you upgrade the server under a FB3lite app, suddenly the way your redirects work changes.</p>
<p>Fortunately, Railo implements the 'location' function as a CFML template, so you can easily go change the default.Â  If you install the WAR version the template is here:</p>
<pre>/WEB-INF/lib/railo-server/context/library/function/location.cfm</pre>
<p>If you install the bundled version, the 'railo-server' directory will be outside the webroot, typically here (thanks Todd):</p>
<pre>{installation-dir}/railo/railo-server/context/library/function/location.cfm</pre>
<p>Changing this file requires restarting your Railo webapp as the files are loaded once on startup.Â  As you'll quickly notice, there are a bunch of functions and tags that are implemented this way, so you can easily modify any or all of them to customize your environment.Â  Just be careful when you upgrade your Railo, as your changes will be overwritten.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.barneyb.com/barneyblog/2010/07/08/tokenless-location-without-parameters/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Groovy DataSources for Railo</title>
		<link>https://www.barneyb.com/barneyblog/2010/05/25/groovy-datasources-for-railo/</link>
		<comments>https://www.barneyb.com/barneyblog/2010/05/25/groovy-datasources-for-railo/#comments</comments>
		<pubDate>Tue, 25 May 2010 16:39:27 +0000</pubDate>
		<dc:creator>barneyb</dc:creator>
				<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[railo]]></category>

		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1522</guid>
		<description><![CDATA[If you've ever wanted to do raw JDBC stuff in your ColdFusion applications, you probably know that you can get a javax.sql.DataSource via this code:
createObject("java", "coldfusion.server.ServiceFactory")
  .dataSourceService.getDatasource("myDSN")
Unfortunately, this doesn't work on Railo, because the result isn't actually a javax.sql.DataSource, it just looks like one (see RAILO-43).  To put that another way, it's duck typed.
Fortunately, [...]]]></description>
			<content:encoded><![CDATA[<p>If you've ever wanted to do raw JDBC stuff in your ColdFusion applications, you probably know that you can get a javax.sql.DataSource via this code:</p>
<pre>createObject("java", "coldfusion.server.ServiceFactory")
  .dataSourceService.getDatasource("myDSN")</pre>
<p>Unfortunately, this doesn't work on Railo, because the result isn't actually a javax.sql.DataSource, it just looks like one (see <a ="https://jira.jboss.org/browse/RAILO-43">RAILO-43</a>).  To put that another way, it's duck typed.</p>
<p>Fortunately, Groovy's "fake" interfaces make beating the typechecks fairly trivial (if kind of ugly):</p>
<pre><cfset variables.my.datasource = createObject("java", "coldfusion.server.ServiceFactory")
  .dataSourceService.getDatasource(my.dsn) />
<g:script>
  def rds = variables.my.datasource
  variables.my.datasource = {
    rds.getConnection()
  } as javax.sql.DataSource
</g:script></pre>
<p>The CFSET gets the "datasource" as normal, and then the little Groovy scriptlet simply wraps it with a closure and tells it to pretend to be a javax.sql.DataSource. The game Escape from Tarkov has one important feature: after your death in a RAID, you lose your equipment. To prevent the loss of important equipment in the game, there are special sites with <a href="https://needmana.com/wow-gold/escape-from-tarkov-currency-and-items/">eft roubles</a> you can always get top equipment and kill all pepegas squad. The items you store from needmana will not disappear. There are three types of containers in total. Alpha, Beta, and Gamma. These containers differ in their size. Usually, these containers should store the most important equipment-maps, ammunition, keys, and so on.  In this case we're assuming that the only method on DataSource that will be invoked is getConnection(), which is the usual case.  If you need to support other methods you'd need to go the Map-as-interface route.</p>
<p>Now we can use variables.my.datasource as a javax.sql.DataSource.  Yay!  Unfortunately, you have to use this sort of snippet everywhere you need a DataSource in your Railo apps, but hopefully that'll get fixed.</p>
<p>For more info on Groovy interfaces, the docs are at <a ="http://groovy.codehaus.org/Groovy+way+to+implement+interfaces">http://groovy.codehaus.org/Groovy+way+to+implement+interfaces</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.barneyb.com/barneyblog/2010/05/25/groovy-datasources-for-railo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ColdFusion vs. CFML</title>
		<link>https://www.barneyb.com/barneyblog/2010/04/07/coldfusion-vs-cfml/</link>
		<comments>https://www.barneyb.com/barneyblog/2010/04/07/coldfusion-vs-cfml/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 16:28:22 +0000</pubDate>
		<dc:creator>barneyb</dc:creator>
				<category><![CDATA[cfml]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[railo]]></category>

		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1450</guid>
		<description><![CDATA[&#60;rant&#62;
Every time TIOBE comes out with new listings people bitch about ColdFusion.Â  It bugs the shit out of me.Â  Here's the deal folks:
ColdFusion is a server product.Â  It is NOT a language.Â  CFML is a language.Â  You don't write ColdFusion, you write CFML and then you run your CFML on ColdFusion (or Railo, or OBD).Â  [...]]]></description>
			<content:encoded><![CDATA[<p>&lt;rant&gt;</p>
<p>Every time TIOBE comes out with new listings people bitch about ColdFusion.Â  It bugs the shit out of me.Â  Here's the deal folks:</p>
<p>ColdFusion is a server product.Â  It is NOT a language.Â  CFML is a language.Â  You don't write ColdFusion, you write CFML and then you run your CFML on ColdFusion (or Railo, or OBD).Â  ColdFusion (or Railo, OBD, etc.) provide a framework for your CFML to run in, along with various bits of helpful functionality.Â  You might consider yourself a ColdFusion developer, because while ColdFusion isn't the language you use, it <strong>is </strong>the framework that you use.Â  You're a ColdFusion developer who writes CFML.</p>
<p>This is exactly like saying you're a JEE developer.Â  People don't write JEE code, they write Java/Groovy/etc. code, but they're still JEE developers.Â  JEE provides a pile of nifty features (Servlets, JNDI, JavaMail, XA, etc.) that you can leverage if you're running your code in a JEE server.Â  And different servers provide different sets of functionality (though all at least meeting the base spec).Â  So you write your Java (or whatever), and run it in a JEE server.Â  You're a JEE developer who writes Java.</p>
<p>This is also exactly like saying you're a Rails developer.Â  People don't write Rails code, they write Ruby code, but they're still Rails developers.Â  Railos provides a framework for your Ruby to run in, along with a pile of helpful functionality.Â  You're a Rails developer who writes Ruby.</p>
<p>I am a ColdFusion developer.Â  I am also Railo developer.Â  I'm also a JEE developer.</p>
<p>I write CFML, Groovy, Java, JavaScript, and a pile of other languages.</p>
<p>So if you want TIOBE to list ColdFusion on there, then they should also list JEE and Rails on there.Â  They don't, they won't, and they shouldn't.Â  Period.Â  End of story.</p>
<p>&lt;/rant&gt;</p>
<p>I've intentionally not linked to the TIOBE listings.Â  They're easy to find if you care, but they're pretty irrelevant.Â  Bordering on retardedly stupid.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.barneyb.com/barneyblog/2010/04/07/coldfusion-vs-cfml/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Goodbye ColdFusion, Hello Railo</title>
		<link>https://www.barneyb.com/barneyblog/2010/03/31/goodbye-coldfusion-hello-railo/</link>
		<comments>https://www.barneyb.com/barneyblog/2010/03/31/goodbye-coldfusion-hello-railo/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 17:23:09 +0000</pubDate>
		<dc:creator>barneyb</dc:creator>
				<category><![CDATA[cfml]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[railo]]></category>

		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1413</guid>
		<description><![CDATA[I've been working towards this for quite some time, and last night I finally replaced ColdFusion with Railo on my personal server.Â  By and large the switch went flawlessly.Â  I made a few compatibility changes ahead of time and found and fixed a few issues subsequently, but really smooth overall.Â  Even better, the memory footprint [...]]]></description>
			<content:encoded><![CDATA[<p>I've been working towards this for quite some time, and last night I finally replaced ColdFusion with Railo on my personal server.Â  By and large the switch went flawlessly.Â  I made a few compatibility changes ahead of time and found and fixed a few issues subsequently, but really smooth overall.Â  Even better, the memory footprint is significantly reduced with Railo, and I'm always memory constrained.Â  I'll run through the migration process and the issues I had in a moment, but first a couple memory charts:</p>
<p><img class="aligncenter size-full wp-image-1414" title="resident_memory" src="http://www.barneyb.com/barneyblog/wp-content/uploads/2010/03/resident_memory.png" alt="" width="640" height="300" /></p>
<p><img class="aligncenter size-full wp-image-1415" title="virtual_memory" src="http://www.barneyb.com/barneyblog/wp-content/uploads/2010/03/virtual_memory.png" alt="" width="640" height="250" /></p>
<p><img class="aligncenter size-full wp-image-1416" title="page_faults" src="http://www.barneyb.com/barneyblog/wp-content/uploads/2010/03/page_faults.png" alt="" width="640" height="250" /></p>
<p>Conversion, as you might imagine, happend right about 20:30.Â  The jaggies you see on the MySQL line are from me manually reducing and then reincreasing it's memory caches.Â  I wanted to make sure it was mostly out of the way while I was converting, and willing to pay a little performance to get it.Â  Unfortunately it makes the charts a little dirtier, but oh well.</p>
<p>The actual migration process was really simple.Â  I spun up a Railo instance on my home computer, configured the server settings, set up my DSNs and mappings, and then shut it down.Â  Then I stopped Tomcat on my production server, moved the WEB-INF folder out of the way, rsynced up Railo's WEB-INF from my home machine to take it's place, and restarted Tomcat.Â  Done.</p>
<p>As for the CFML itself, I ran into a very small number of distinct issues, though they manifested in different ways:</p>
<ul>
<li>Railo doesn't support the column-as-array notation for queries that ColdFusion does (e.g. arrayMax(query["column"])), which I had used extensively in building Google Charts.Â  Fortunately they expose valueArray to compliment valueList, as well as supporting a string (static or dynamic) rather than just the reference (all CF allows).Â  This change made most of the instances cleaner, though you have to use a temp variable if your query isn't in an implicitly referenceable scope or nested within a complex structure, because the string must two-part.</li>
<li>Railo doesn't support escaping keywords in queries of queries.Â  Fortunately it's not as anal about keywords (e.g., allowing "get"), but if you want to alias a column to "count", you're screwed.Â  Interestingly, you can happily select from a column named "count", just not alias to it.Â  It also has some weird issues when combining aggregation and union on timestamp fields (they get truncated to dates).</li>
<li>Railo arrays don't support the .subList method from java.util.List.Â  It's implemented, but is hard coded to throw a RuntimeException.Â  I beat this via a subList UDF:
<pre>&lt;cffunction name="subList" output="false"&gt;
  &lt;cfargument name="a" /&gt;
  &lt;cfargument name="s" /&gt;
  &lt;cfargument name="e" /&gt;
  &lt;cfset var aa = [] /&gt;
  &lt;cfset var i = "" /&gt;
  &lt;cfloop from="#s + 1#" to="#e#" index="i"&gt;
    &lt;cfset arrayAppend(aa, a[i]) /&gt;
  &lt;/cfloop&gt;
  &lt;cfreturn aa /&gt;
&lt;/cffunction&gt;</pre>
<p>It doesn't carry the same semantic as List.subList (which returns a view of the original list, not a new list), but for my purposes it was sufficient.</li>
<li>Inline CFMAILPARAM attachments that use a contentId must have the id manually wrapped with angle brackets as Railo doesn't do the wrapping for you like ColdFusion does.Â  Easily fixed, though this one was actually caught by an end user.Â  Oops.</li>
<li>"url is not a valid unscoped variable name as Railo assumes it means the url scope.Â  You must either qualify it with a scope, or avoid the name.Â  "cluster" has the same problem.Â  As you might imagine, the url-scraping acquisition and cluster-based prioritization of PotD made these two names quite common, so I had to fix a lot of instances.Â  But it was my fault for being lazy and not scoping to begin with.</li>
<li>Railo respects and enforces an "abstract" attribute on CFFUNCTION that requires the body to be empty (just like CFFUNCTION within CFINTERFACE).Â  I use an "abstract" attribute frequently for metadata inspection, but always implement the method with a single CFTHROW tag (since CF doesn't understand abstractness).Â  The error message Railo generates is misleading ("cannot nest CFTHROW within CFFUNCTION" rather than "abstract functions cannot have a body"), but once I figured out what the issue was fixing it was simple.</li>
<li>imageSetDrawingColor accepts three comma-seperated decimal values (e.g., "128,128,256&#8243; for a blueish hue), but Railo does not.Â  Easily fixed with formatBaseN.</li>
</ul>
<p>All in all, a pretty transparent migration.Â  I'm quite pleased.Â  And now I'm in a position to get CFML-based ORM without having to fork over the $4,000 to upgrade to CF9, which is a big win for me.Â  I'm sure little stuff will probably crop up over the next week or two, but all the major pieces (and all the minor bits I checked) seem to have worked flawlessly.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.barneyb.com/barneyblog/2010/03/31/goodbye-coldfusion-hello-railo/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Moving Pic of the Day Foiled Again</title>
		<link>https://www.barneyb.com/barneyblog/2010/03/10/moving-pic-of-the-day-foiled-again/</link>
		<comments>https://www.barneyb.com/barneyblog/2010/03/10/moving-pic-of-the-day-foiled-again/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 06:03:10 +0000</pubDate>
		<dc:creator>barneyb</dc:creator>
				<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[potd]]></category>
		<category><![CDATA[railo]]></category>

		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=1365</guid>
		<description><![CDATA[A while back I made an attempt to move Pic of the Day (NSFW) off of ColdFusion 8 and onto Railo 3.Â  I can't afford a license of CF9, so my only upgrade path is through a free alternative.Â  Unless someone has an extra four grand they want to give me&#8230;.
Last time I was foiled [...]]]></description>
			<content:encoded><![CDATA[<p>A while back I made an attempt to move <a href="http://potd.barneyb.com/how.html">Pic of the Day</a> (NSFW) off of <a href="http://www.adobe.com/go/coldfusion">ColdFusion</a> 8 and onto <a href="http://www.getrailo.org/">Railo</a> 3.Â  I can't afford a license of CF9, so my only upgrade path is through a free alternative.Â  Unless someone has an extra four grand they want to give me&#8230;.</p>
<p>Last time I was foiled by CFHTTP adding a spurious Content-Type header on GET requests, which breaks secure downloads from S3 (which is where I host all the content).Â  I reported the bug and it got fixed, but I hadn't had time to revisit the migration process so there it sat.Â  Until this evening, that is.</p>
<p>I'm glad to say that the issue with GET requests has been completely resolved.Â  The bleeding edge is also a lot smoother than last time I pulled down a new version, so props to those guys.Â  Setting up a migration test environment actually proved pretty straightforward, even with all the crazy Apache and OS integration PotD leverages.</p>
<p>As expected, there were errors on the first page load, but nothing some trickery with mappings and rewriting a couple query of queries couldn't fix.Â  After that, everything just worked.Â  Thumbnail generation, S3 access, emailing, everything.Â  Except that it wasn't everything.Â  Turns out that exactly the same problem I had with GET requests before has no manifested itself with DELETE requests.Â  So I'm again stuck.</p>
<p>The way PotD is implemented, images are spidered and pushed immediately onto S3.Â  Then they go through the filter pipeline, and many (most?) of them are deleted.Â  So being able to remove stuff from S3 is a pretty core feature, otherwise I'd have piles and piles of orphaned files up there, and that just costs me money for no reason.Â  Sadly, this makes Railo a no-go again, and leaves me with CF8 for a while longer.</p>
<p>I've actually got a lot of stuff in the works surrounding my personal sites and projects, but the CF to Railo conversion is one of the larger ones as well as the one with the largest potential impact on server resources (which I'm continually constrained by).Â  The move from JRun to Tomcat was a huge help, but I could definitely use more and Railo gives all apperances of being able to give it to me.Â  Also have some major WordPress infrastructure changes, a whole rebranding of this (my blog), and a few other corollary improvements.</p>
<p>The overarching goal is to simplify my URL space so I don't have as much interleaving between separate applications.Â  www.barneyb.com's URL space, for example, houses 3 different blogs, two static sites, and a pile of little CFML apps.Â  ssl.barneyb.com houses SVN, Trac, PotD, and several other CFML apps.Â  It's a mess, but that'll be a lot better, regardless of what happens with the CFML engine stuff.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.barneyb.com/barneyblog/2010/03/10/moving-pic-of-the-day-foiled-again/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Latest ColdFusion MindÆ’ÂµÂ©Òœ</title>
		<link>https://www.barneyb.com/barneyblog/2009/04/13/the-latest-coldfusion-mindscrew/</link>
		<comments>https://www.barneyb.com/barneyblog/2009/04/13/the-latest-coldfusion-mindscrew/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 16:31:08 +0000</pubDate>
		<dc:creator>barneyb</dc:creator>
				<category><![CDATA[cfml]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[railo]]></category>

		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=828</guid>
		<description><![CDATA[It's pretty common knowledge that ColdFusion passes arrays to UDF by value, and not by reference like pretty much every other language.Â  It's a weird behaviour, but as long as you remember to write array-processing functions to be used like this:
&#60;cfset myArray = modifyArray(myArray) /&#62;
instead of like this:
&#60;cfset modifyArray(myArray) /&#62;
you'll be fine.Â  However, someone pointed [...]]]></description>
			<content:encoded><![CDATA[<p>It's pretty common knowledge that ColdFusion passes arrays to UDF <em>by value</em>, and not by reference like pretty much every other language.Â  It's a weird behaviour, but as long as you remember to write array-processing functions to be used like this:</p>
<pre>&lt;cfset myArray = modifyArray(myArray) /&gt;</pre>
<p>instead of like this:</p>
<pre>&lt;cfset modifyArray(myArray) /&gt;</pre>
<p>you'll be fine.Â  However, someone pointed out on the Railo mailing list that this behaviour is not constrained to UDFs.Â  Assignment behave the same way!Â  Yes, if you assign an array to another variable, you get a copy.Â  The only "assignment" that is exempt from this behaviour is if you use structInsert.</p>
<p>Consider this code:</p>
<pre>&lt;cfset a = [37] /&gt;
<span style="color: #0000ff;">&lt;cfset a2 = a /&gt;</span>
<span style="color: #0000ff;">&lt;cfset s1 = {array = a} /&gt;</span>
&lt;cfset s2 = {} /&gt;
&lt;cfset s3 = {} /&gt;
&lt;cfset s4 = {} /&gt;
<span style="color: #0000ff;">&lt;cfset s2.array = a /&gt;</span>
<span style="color: #0000ff;">&lt;cfset s3["array"] = a /&gt;</span>
<span style="color: #ff0000;">&lt;cfset structInsert(s4, "array", a) /&gt;</span>
<span style="color: #008000;">&lt;cfset arrayAppend(a, 42) /&gt;</span>
&lt;cfset System = createObject("java", "java.lang.System") /&gt;
&lt;cfoutput&gt;
&lt;p&gt;#System.identityHashcode(a)# - #a.toString()#               &lt;!--- [37, 42] ---&gt;
&lt;p&gt;#System.identityHashcode(a2)# - #a2.toString()#             &lt;!--- [37]     ---&gt;
&lt;p&gt;#System.identityHashcode(s1.array)# - #s1.array.toString()# &lt;!--- [37]     ---&gt;
&lt;p&gt;#System.identityHashcode(s2.array)# - #s2.array.toString()# &lt;!--- [37]     ---&gt;
&lt;p&gt;#System.identityHashcode(s3.array)# - #s3.array.toString()# &lt;!--- [37]     ---&gt;
&lt;p&gt;#System.identityHashcode(s4.array)# - #s4.array.toString()# &lt;!--- [37, 42] ---&gt;
&lt;/cfoutput&gt;</pre>
<p>At the end of this code, there are five distinct arrays, one containing 37 and 42, and the other four containing only 37.Â  The blue lines create the four copies, and the red line creates a new "pointer" to the existing array.Â  Then when the green line executes the original array has 42 added to it, which only affects 'a' and 's4.array', because the rest are copies.</p>
<p>On Railo, arrays are universally reference types, so there would only be a single array in the above example.Â  This is consistent with most other languages.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.barneyb.com/barneyblog/2009/04/13/the-latest-coldfusion-mindscrew/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ben Nadel &#8211; At It Again</title>
		<link>https://www.barneyb.com/barneyblog/2009/04/07/ben-nadel-at-it-again/</link>
		<comments>https://www.barneyb.com/barneyblog/2009/04/07/ben-nadel-at-it-again/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 16:18:45 +0000</pubDate>
		<dc:creator>barneyb</dc:creator>
				<category><![CDATA[cfml]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[railo]]></category>

		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=809</guid>
		<description><![CDATA[Ben Nadel posted another interesting code snippet this moring.Â  I think Ben and I stand in agreement on the technique: NEVER EVER USE IT.Â  It leverages a horrible bug in ColdFusion's implementation of struct literals that I've blogged about previously.
Here's the snippet:
&#60;cfset objConfig = {
  root = getDirectoryFromPath(getCurrentTemplatePath()),
  tags = objConfig.root &#38; "tags/",
 [...]]]></description>
			<content:encoded><![CDATA[<p>Ben Nadel posted another<a href="http://www.bennadel.com/blog/1556-Ability-To-Leverage-ColdFusion-Bug-Will-Mean-Errors-Later.htm"> interesting code snippet</a> this moring.Â  I think Ben and I stand in agreement on the technique: NEVER EVER USE IT.Â  It leverages a horrible bug in ColdFusion's implementation of struct literals that I've <a href="http://www.barneyb.com/barneyblog/2008/07/14/coldfusion-struct-literals-fail-again/">blogged about previously</a>.</p>
<p>Here's the snippet:</p>
<pre>&lt;cfset objConfig = {
  root = getDirectoryFromPath(getCurrentTemplatePath()),
  tags = objConfig.root &amp; "tags/",
  com = objConfig.root &amp; "com/"
} /&gt;</pre>
<p>Yes, that actually works.Â  Let me repeat, NEVER EVER USE IT.Â  It is the devil incarnate, and only works because of a horrible implementation error in Adobe ColdFusion.Â  Note this is a ColdFusion bug, <em>not a CFML language issue</em>.Â  Railo implements struct literals correctly (as well as treating them as expressions instead of statements).Â  I don't know about OBD &#8211; the last time I used it there wasn't struct literal support at all, but it's been a while.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.barneyb.com/barneyblog/2009/04/07/ben-nadel-at-it-again/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CFCOOKIE Bug in Railo</title>
		<link>https://www.barneyb.com/barneyblog/2008/12/02/cfcookie-bug-in-railo/</link>
		<comments>https://www.barneyb.com/barneyblog/2008/12/02/cfcookie-bug-in-railo/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 01:21:28 +0000</pubDate>
		<dc:creator>barneyb</dc:creator>
				<category><![CDATA[railo]]></category>

		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=559</guid>
		<description><![CDATA[Found another minor bug in Railo today: CFCOOKIE doesn't accept a date passed to it's 'expires' attribute.Â  It happily accepts 'now', 'never', and a number of days, but not an actual date.Â  Submitted as JIRA-149.
]]></description>
			<content:encoded><![CDATA[<p>Found another minor bug in Railo today: CFCOOKIE doesn't accept a date passed to it's 'expires' attribute.Â  It happily accepts 'now', 'never', and a number of days, but not an actual date.Â  Submitted as <a href="https://jira.jboss.org/jira/browse/RAILO-149">JIRA-149</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.barneyb.com/barneyblog/2008/12/02/cfcookie-bug-in-railo/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Railo-147 Resolved</title>
		<link>https://www.barneyb.com/barneyblog/2008/11/27/railo-147-resolved/</link>
		<comments>https://www.barneyb.com/barneyblog/2008/11/27/railo-147-resolved/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 17:08:09 +0000</pubDate>
		<dc:creator>barneyb</dc:creator>
				<category><![CDATA[railo]]></category>

		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=557</guid>
		<description><![CDATA[To quote my post Tuesday about Railo bug 147:
Railo has an issue with non-defaulted, non-required, numeric method arguments that are omitted from a call.Â  I added it as bug 147 in JIRA.
Turns out I was a bit incorrect &#8211; I'd forgotten that method was proxied by ColdSpring's AOP engine (which is exactly what's supposed to [...]]]></description>
			<content:encoded><![CDATA[<p>To quote my post Tuesday about Railo bug 147:</p>
<p style="padding-left: 30px;">Railo has an issue with non-defaulted, non-required, numeric method arguments that are omitted from a call.Â  I added it as <a href="https://jira.jboss.org/jira/browse/RAILO-147">bug 147</a> in JIRA.</p>
<p>Turns out I was a bit incorrect &#8211; I'd forgotten that method was proxied by ColdSpring's AOP engine (which is exactly what's supposed to happen with AOP), and that's where the bug actually resided.Â  Railo was returning "[runtime expression]" as the default value for the argument within the function metadata, which ColdSpring was faithfully writing into the proxy method that it generates.</p>
<p>In any case, got a JIRA update from Michael to say it's been resolved, so the next build should have it fixed up.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.barneyb.com/barneyblog/2008/11/27/railo-147-resolved/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
