Forum: Ruby on Rails IBM UniVerse database adapter for ActiveRecord?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Guido S. (Guest)
on 2006-05-14 06:34
(Received via mailing list)
I'm facing a situation where I am going to have to integrate with a
legacy database , specifically the IBM UniVerse database, which is not
*quite* relational. It feels like a holdover from the dark ages of
computing.

Before I attempt writing an ActiveRecord adapter, I'd like to know if
anyone else uses this database and if I'm the only person that needs
this thing. I could integrate by writing a Java web service, but I
prefer to keep it all in Rails.

Let's see if this gets any responses ...

-- G.
Charles O Nutter (Guest)
on 2006-05-14 07:13
(Received via mailing list)
Perhaps running under JRuby would be an option since you've got a
peculiar
scenario? We have an ActiveRecord to JDBC adapter working already which
we're currently using on MySQL for demo apps. If there's a JDBC driver
available, it might not require much to hook in your UniVerse.
Guido S. (Guest)
on 2006-05-14 08:19
(Received via mailing list)
Thanks for the reply. There is a JDBC driver available for UniVerse,
though I haven't been able to get my hands on it yet. Another option
is to do screen scraping under telnet but I'm not crazy about that
approach.

I'm willing to split off the whole application to isolate the
ActiveRecord parts (and a web service API) into JRuby and use the web
service to get the real app server talking to the JRuby portion.

Are ActiveRecord and ActionWebService working well under JRuby? I
don't care about the rest of Rails, just those two pieces working
from within a controller will be OK for me.

Some background. I'm fetching a bank account balance to supply to a
RoR app that will use Asterisk and a text to speech engine to speak
that balance back to the user, so performance wise, it has to happen
during the phone call. Performance is not too much of a problem for
me, since I'm fetching only one record at a time on demand. One extra
second won't kill me :-) But it needs to work each time, no crashes.

I'll take a look at the ActiveRecord -> JDBC bridge. Again, thanks!!!!

-- G.
Guido S. (Guest)
on 2006-05-14 08:19
(Received via mailing list)
Forgot to ask. What release of JRuby to go for? Is CVS HEAD in good
working condition? Or I should go for something else?

-- G.
Charles O Nutter (Guest)
on 2006-05-14 09:20
(Received via mailing list)
The JDBC stuff is not yet in CVS, but it oughta be in there soon. It's
work
we did to get a simple rails app working, and it's just gotten to the
point
of usability in the past couple days. However, it's very promising...and
we
really want to get it out to others to test out additional drivers and
deployment scenarios. We've also got a major JRuby release coming out
very
soon that will move things along tremendously.

We're at JavaOne next week, but jump on the JRuby mailing lists and
we'll
wee if we can get you a snapshot of the current code.
Martin Smith (Guest)
on 2006-05-14 16:23
Why do you need to use ActiveRecod to read the data from Universe?  I
think your web service idea sounds better, and simpler, as all you need
is the balance returning to rails.

I have previously used the UniObjects for Java API to talk to UniData
(very similar to Universe and also from IBM).

This doesn't use JDBC, it uses the Pick/UniData/UniVerse style nested
data structure.

To use JDBC with UniData was a pain.  I had to create a seperate table
that held the SQL 'view' of the nested UniData table.

The manual for UniObjects for Java is here:
http://publibfi.boulder.ibm.com/epubs/pdf/25125720.pdf

You could build a Java DAO using UniObjects for Java and expose this
using a web service to rails.

You might find more info here.

http://www-306.ibm.com/software/data/u2/middleware...

This folowing link also says about exposing UniVerse data as a web
service.

http://www-128.ibm.com/developerworks/db2/library/...

Let me know how you get on.

Martin
Guido S. (Guest)
on 2006-05-15 19:01
(Received via mailing list)
I've checked out CVS HEAD and managed to install rails via gems using
it. I had to make some change to the File class and in a couple of
other places, but it's getting to the point where it will work soon.

I think it's still too slow now. Not the sort of thing I can bank on
at this point. But we knew that already, didn't we? :-) I'll keep on
investigating ...

-- G.
Guido S. (Guest)
on 2006-05-15 19:07
(Received via mailing list)
I think I agree. The simplest way out is to use the web services as
glue between the two components. I've gotten JRuby working in a very
basic way, but it is likely to be too slow to handle the transaction
while keeping someone waiting on the line ...

I'm looking at the UniObjects API as well as the C call level API. I
didn't know about creating the separate table issue. I don't think
that I will be able to do that on a production database that is very
critical to the organization ...

-- G.
Charles O Nutter (Guest)
on 2006-05-15 22:32
(Received via mailing list)
Thanks for giving it a shot. In some scenarios, JRuby is still a little
slow, but it's improving very quickly. At any rate, it sounds like the
JDBC
option for UniVerse isn't the greatest choice in the first place, and
using
more specific APIs will be a better bet for you.
Charles O Nutter (Guest)
on 2006-05-15 22:35
(Received via mailing list)
BTW, if you have a patch for any of JRuby code, please send it along.
Gems
weren't working when I last tried them, but that was several weeks ago
before our last Rails push. If they're working now, all the better!
This topic is locked and can not be replied to.