talideon.com

I can be ultramagnus!

September 23, 2004 at 11:04PM Merant SequeLink JDBC Driver and ColdFusion horribleness

A note of caution to all those people out there using ColdFusion MX and and MySQL: do not--I can’t emphasise this enough--connect to an MySQL database through the Merant SequeLink JDBC Driver. Not that I’ve anything against it, but it’s slower--naturally--than using the appropriate direct driver and there appears to be some nasty hidden conflicts between the two when you use enum columns.

Today I was hacking away on a site at work when I noticed that some enum columns that contained text were getting a stray space at the end. Now, I checked MySQL, and it wasn’t spitting it out, and myself and Peter hacked away trying to find a solution to this, but we’d no luck. This problem wasn’t just affecting my code, but one of our products too.

In the end, Pete just put in a hack to trim the extra space. My theory was that it had to be one of the drivers, but didn’t have time to check it.

Well, I’m after getting time, and I changed the data source to use a direct connection to MySQL, and problem went magically away.

The use of the ODBC Socket driver was a leftover from the upgrade tool for converting from ColdFusion 5 to CFMX. Newer data sources that we’d created were direct connections, so they didn’t have these problems. Mustn’t forget that for when we upgrade the live server.

So the moral is, connect directly to your database if possible rather than going through ODBC: it’ll save you a world of pain.

Technorati Search Technorati Search Irish Bloggers

Comments

1 On February 10, 2006 at 19:22, Micheal wrote:

thats cool how did ou do the direct connection without the use of dsn

2 On February 11, 2006 at 12:01, Keith wrote:

You can make a direct connection in CFMX to a database and still use DSNs. The big difference between DB access in CFMX and classic ColdFusion (5 and prior) is that CFMX uses Java drivers. All I did was use the actual MySQL driver rather than using the CF ODBC driver to connect to it indirectly. There’s no deep magic here, I’m afraid.

Post a comment

All form information is optional, but it’s a good idea to fill in your name and email address if you want me to take your comment seriously.

Spammers, don’t bother posting crap down here. The site is set up so that legitimate search engines (Google, for instance) won’t index pages with comments on them. Posting crud here only means you’re wasting my time and patience. Shoo!

Real names, please. Please include!
Won’t be displayed. Please include!
Displayed, if present.