A major milestone for DB2 on Rails

The IBM API development team has released version 1.0 of the ibm_db gem, which includes both the Ruby driver, and the Rails adapter, for IBM’s databases. This is a very important milestone for the DB2 on Rails community, and it ships with quite a few goodies.

Besides a few bug fixes, this version adds support for DB2’s secure connections via SSL, short-hands to use char, double and xml when using both create_table and change_table in Rails’ new “sexy migrations”, and enables change_column_null to work with DB2.

Even more importantly, it adds support for Transactional Migrations in Rails 2.2. What this means to you is that any DDL changes performed by a migration file before an exception has been raised, will be rolled back by DB2. This is a handy new feature in Rails 2.2, and our gem backed support for it, even before this version of Rails was shipped.

Speaking of Rails 2.2, which is about to be released, you’ll finally be able to run rails my_app -d ibm_db. This will generate a DB2-specific config/database.yml file. This move is possible thanks to a patch that was submitted by IBM to the Rails team. As handy as it is, the great news is not so much in this new feature, but rather in the fact that the Rails team has shown that they’re open to accepting patches that extend features to commercial databases as well, and not only the three open source ones they support. This can open up a world of possibilities for the future of DB2 on Rails, and it will mean less reliance on external plugins.

As usual, install as follows (on *nix systems):


$ . /home/db2inst1/sqllib/db2profile
$ export IBM_DB_DIR=/home/db2inst1/sqllib
$ export IBM_DB_LIB=/home/db2inst1/sqllib/lib
$ sudo gem update
$ sudo gem install ibm_db

On Windows, simply run:


gem install ibm_db
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Posted by Antonio Cangiano | November 08 2008 09:13 pm | Announcements

20 Responses to “A major milestone for DB2 on Rails”

  1. Brandon on 09 Nov 2008 at 3:08 pm #

    I would be very interested in this, but there’s no Mac OS X version of DB2 Express-C. If you want many adopters in the Rails world, this is nearly a requirement. Even though deployment is generally done on Linux, experimentation with new tools for most Rails developers will take place on the Mac, or it won’t take place at all.

    Of course we could run it on VMware or Parallels, or another machine, but that’s not really worth the pain to most people. To adopt DB2, I need to be able to use it as my default database, otherwise I’m not really going to be able to practically learn it. If I’m not using it everyday and living with it, and getting to know it intimately, then it’s not going to seem to be a very safe choice for production.

    I suspect IBM is still writing off Apple as irrelevant. This would be foolish: the people on the cutting edge, who have more influence than the rest of the market, are to a much greater extent choosing Apple products. If IBM wants to benefit from this influence, it should stop ignoring the Mac platform.

    Please take this as feedback, rather than criticism. It is not meant to be hostile at all.

  2. Brandon on 09 Nov 2008 at 3:08 pm #

    P.S. Congratulations on reaching 1.0, and thanks for all your hard work!

  3. Antonio Cangiano on 09 Nov 2008 at 5:42 pm #

    Hi Brandon,

    thanks for your feedback. As a Mac user myself I know how frustrating it can be not having a DB2 version available to toy with. Some people managed to build a working Ruby driver on the Mac, by downloading a common IBM client from the Informix section of the IBM website, but this isn’t an ideal solution.

    Please note however that IBM is very interested in getting DB2 on the Mac. It is admittedly taking longer that we’d all like, but there is a team dedicated to this effort. There were a few technical challenges and a new version of DB2 is about to come out (currently in beta on Windows) as well. According to what they told me, they are very close to being done but couldn’t provide me with a release date so as to not get anyone’s hopes up quite yet. I’m looking forward to this as much as you are and I keep “bugging” them for updates.

    The moment DB2 on Mac becomes available, the readers of my blog and this blog will be the first ones to learn about it.

  4. Milestone for DB2 on Rails on 09 Nov 2008 at 8:25 pm #

    [...] Antonio Cangiano writes A major milestone for DB2 on Rails. [...]

  5. Leonardo Borges on 10 Nov 2008 at 6:23 am #

    Any success installing on Ubuntu 8.04?

    I manageg to get it working on 7.10 but on 8.04 it fails as if I haven’t set up the correct environment variable, even though I did. I wonder if ubuntu’s upgrade messed things up…

  6. Double Shot #329 « A Fresh Cup on 10 Nov 2008 at 6:34 am #

    [...] A major milestone for DB2 on Rails - Those who think Rails has no place in the enterprise should note that IBM is officially supporting it with a brand-new DB2 adapter, including transactional migration support. (via Riding Rails) [...]

  7. Pratik on 10 Nov 2008 at 7:24 am #

    @Antonio : Worst part is, you can’t even get the client libs to compile on OS X ! So you can’t work with an ibm db running on another local linux box :(

  8. Antonio Cangiano on 10 Nov 2008 at 9:31 am #

    Leonardo, I ran it on Ubuntu 8.04 without encountering any issues. Please get in touch with me through GTalk so that we can figure out what’s wrong.

    Pratik, yes that’s the problem. Hopefully this will be addressed soon with a fully fledged DB2 installation that’s available for Mac.

  9. links for 2008-11-10 « Brent Sordyl’s Blog on 10 Nov 2008 at 10:02 am #

    [...] A major milestone for DB2 on Rails | DB2 on Rails Speaking of Rails 2.2, which is about to be released, you’ll finally be able to run rails my_app -d ibm_db. This will generate a DB2-specific config/database.yml file. (tags: rubyonrails db2) [...]

  10. Nome do Jogo » Blog Archive » Rails Podcast Brasil - Episódio 37 on 11 Nov 2008 at 10:03 am #

    [...] A major milestone for DB2 on Rails [...]

  11. Paul on 11 Nov 2008 at 10:15 am #

    Sorry to switch gears on the Mac OS subject, but does this update also apply to the iSeries version of DB2?

    Most of the information I see (I haven’t really gone deep enough) seems to apply to the Linux and Windows versions of DB2 Express. I never hear any mention of DB on IOS or ZOS. Is IBM dropping support for this type of support on the I?

  12. Praveen on 11 Nov 2008 at 10:32 am #

    Hi Paul,

    Yes, the ibm_db gem supports Remote connections to IBM DB2 Universal Database on i5/OS versions V5R3 and V5R4 and also remote connections to IBM DB2 Universal Database on z/OS version 8 and 9.

    For every release we verify our gem against DB2 on LUW along with DB2 on iseries and zOS and also Informix Dynamic Server.

    Thanks

    Praveen

  13. Leonardo Borges on 11 Nov 2008 at 3:31 pm #

    Just to share how we solved it, I was just chatting with Antonio and it turned out that I had to install it as root (sudo -s) to make it work.

    Tks for your usual support Antonio. :)

  14. Antonio Cangiano on 11 Nov 2008 at 3:36 pm #

    You are very welcome, Leo. I think a post about common pitfalls is in order. I’ll write one soon. :-)

  15. Paul on 11 Nov 2008 at 7:45 pm #

    Praveen: “Yes, the ibm_db gem supports Remote connections to IBM DB2 Universal Database on i5/OS versions V5R3 and V5R4…”

    You rock Praveen! Now if we can only get Microsoft to wake up and officially support SQL Server. ;)

    Paul

  16. David Andrew Thompson on 14 Nov 2008 at 11:06 pm #

    What about the AS400? I was working on a project for a company using the AS400 for their retail backend and did not have any success using ibm_db in its previous versions. –thanks by the way…great work!!

  17. ?????? ??????? » ??????????????????#27 on 16 Nov 2008 at 5:08 am #

    [...] A major milestone for DB2 on Rails | DB2 on Rails [...]

  18. Brandon on 19 Nov 2008 at 1:42 am #

    Thanks Antonio for the response. It’s good to know IBM is working on DB2 for Mac. I’d love to get ahold of a beta… and if you have any wild guesses (which we won’t hold IBM to!) about when it might be available, I’m all ears.

  19. Antonio Cangiano on 19 Nov 2008 at 11:08 am #

    Thanks Brandon, it’s hard to tell when DB2 on Mac will be ready since there is no official release date yet. If I had to make an educated guess, not something I’d like to be quoted for, I’d say that we’ll probably have a release by Christmas. Or at least I hope so, as that would be a nice gift.

  20. Pete Helgren on 19 Nov 2008 at 1:19 pm #

    Any idea when a “native” DB2 for i5/OS release is coming? As much as I appreciate the “remote” connection option, that still requires that I have a Windows, Linux or Unix flavor of OS to run in. I’d love to see something that will run in PASE (at least).

    My Rails work has moved to using JRuby and Rails primarily because of this limitation. JRuby and Rails, using JDBC works with some tweaks but using an IBM supported gem from within PASE would be better.

Trackback URI | Comments RSS

Leave a Reply