By barneyb on May 25, 2010
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, [...]
Posted in coldfusion, groovy, railo
By barneyb on May 18, 2010
Next Tuesday (May 25th), I will be presenting CFGroovy to the Tulsa CFUG via Connect. Details are at http://www.tulsacfug.org/meetings.cfm, but the important bit is that it's at 12:30 central time, not in the evening. Steve Bryant – who manages the group – graciously extended a general invitation to anyone else who would like to join [...]
Posted in coldfusion, groovy
By barneyb on April 25, 2010
Last Wednesday evening Sean Corfield and I were chatting over beers and he caught me by surprise with a statement he made. We were talking about the ORM functionality in CF9, and he liked how it just worked. You invoke a setter, and it gets to the database with nothing else. I agree in theory, [...]
Posted in coldfusion, orm
By barneyb on April 14, 2010
Unlike my last several posts, this one isn't ORM related. At least not directly. If you're using ORM, you necessarily care about your domain model's integrity, as it's a prerequisite for ORM doing it's job, but it has nothing to do with ORM specifically. The point of a domain model is to be a representation [...]
Posted in coldfusion, database, development, orm
By barneyb on April 12, 2010
I do. Because god knows front controllers and persistence layers don't have a one-to-one correspondence. Turns out that through the magic of application switching you can do it, as long as you're careful with your sessions. Not going to go into details right now, but this code works (and does what you'd expect):
<cfapplication name="ormtest1″ />
<cfset [...]
Posted in coldfusion, orm
By barneyb on April 9, 2010
When you're mapping relationships with Hibernate, you have to reconcile the uni-directional nature of Java references with the bi-directional nature of RDBMS foreign keys. Consider this simple database schema with a single relationship:
+———-+
+——–+ | PET |
+ PERSON | +———-+
+——–+ | [...]
Posted in coldfusion, database, orm
By barneyb on April 7, 2010
Continuing the transactions thread, I wanted to talk about a couple specific reasons that transactions are vitally important in ORM applications. Even more than in raw-SQL applications. I consider them mandatory anywhere, but I would argue that if you feel compelled to skip them for some reason, you'd be better off leaving them out of [...]
Posted in coldfusion, database, orm
By barneyb on April 7, 2010
<rant>
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). [...]
Posted in cfml, coldfusion, personal, railo
By barneyb on April 5, 2010
As with any new persistence technology, CF9's ORM functionality has necessitated porting my TransactionAdvice for ColdSpring. The previous "CFML" version was really "CFML/SQL/ORM" and is still the way to go if you're not using ORM functionality. The new version (cf9ormtransactionadvice.cfc) is specific to ORM applications on CF9.0. It will not provide transactionality for SQL-based apps [...]
Posted in coldfusion, orm
By barneyb on March 31, 2010
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 [...]
Posted in cfml, coldfusion, meta, railo