By barneyb on July 23, 2010
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 [...]
Posted in database, railo
By barneyb on May 5, 2010
I'd like to start with a confession. I love SQL (and it's Hibernate counterpart HQL). Its simplicity and elegance is remarkable. Its expressive power is stunning. It is almost universally disliked by developers. Why is that?
The answer, at least to me, is pretty straightforward. Developers spend a lot of their time programming, so that's where [...]
Posted in database, 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 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 6, 2010
Transactions are important, and I wanted to talk about them a little, particularly as they relate to ORM. If you're on the cf-orm-dev mailing list you've undoubtedly seen this topic come up over and over again. And probably started muting conversations when my name shows up. But before digging into the details, we need to [...]
Posted in database, orm
By barneyb on March 22, 2010
I'm sure I wasn't the only one that was sorely disappointed when Adobe released CF9 without the ability to execute HQL queries via the CFQUERY tag. Using a function (ormExecuteQuery) works, but it's really ungainly if you have complex – or even just long – HQL or need to build your statement conditionally, and you [...]
Posted in cfml, coldfusion, database
By barneyb on April 30, 2009
While tuning my new server, I came across an article on MySQL tuning that does a really great job of laying out the main options that need to be tweaked, as well as explaining what they do. It's several years old, but still applicable. Also worth mentioning that MySQL ships with four "sample" configuration files [...]
Posted in database
By barneyb on April 27, 2009
I've been fighting this god-forsaken query for a week, and can come up with absolutely no explaination for its behaviour. Next time I see you, I'll buy you a beer if you can help me understand what's going on. There are two tables involved, and here are their CREATE statements:
CREATE TABLE `sequence` ( — contains [...]
Posted in database
By barneyb on April 15, 2009
I've been bit by this twice in the past few months: comparing database columns that aren't the same type is really really expensive. If you've only got a few rows, no big deal, but if you've got a few hundred thousand (or a few tens of millions) it makes a huge difference. And varchar is [...]
Posted in aside, database