login
Blurts on the Art of Software Development

Today | RSS | RDF | Atom | Other Tags
Categories : All | All | CI | .NET | General | Humour | Java | Personal | Reviews | Ruby | SW Eng

One Rick Bradley reports on a J2EE-turned-Rails project which is experiencing an amazing 1:25 ratio between trivial LOC counts between the two platforms.

That in itself isn't that interesting, however. I've already seen plenty of similar reports and my own experiments have hinted at something around that ballpark as well. What's interesting is that Rick needs nested transactions to implement certain regulatory requirements.

This gets us to the topic of Ruby on Rails and enterprise features.

We don't have nested transactions in the current J2EE spec but there are some workarounds available for implementing some kind of nested transactions in J2EE by hand. (Then again, how many times you've seen someone actually doing that?) As far as I know, there's no known workaround yet for implementing nested transactions with Ruby on Rails. That's a small advantage for J2EE. (Then again, I wouldn't be surprised if someone was already working on adding nested transaction support by now)

Another "enterprise feature" Rails is lacking is distributed transactions, i.e. two-phase commit. J2EE obviously has this but Rails is currently limited to simple transactions even though it is possible to split your domain objects to be persisted in multiple databases.

Authentication is another feature that people seem to have "extra" requirements for in enterprise environments. Again, Rails doesn't support Single Sign-On (SSO) out of the box but adding support for, say, perimeter authentication with SiteMinder and Apache should be as trivial as it is in J2EE.

I'd be interested to hear what other features you'd consider belonging to this "enterprise" category that Rails doesn't have (or you're not sure if it has).


Supported Oracle connectivity.
Oracle? But Oracle is already supported along with many others.
Last I checked it was, like Python's OCI8-using Oracle connectors, seriously slow and leaked memory. Ruby's Oracle connector will be supported when I can get someone to fix those bugs according to some known process by providing money or gratitude.
Ok. I see. Have you logged a ticket?
Ah. I see Jon Tirsen has just blogged around the same (sort of) topic.
I'm quite familiar with the assorted bug tracking systems of promising technology solutions. The point is that I have no particular reason to believe that these issues will be fixed, which means that when I use Rails for an important app and it doesn't work, and the bug is somewhere where it's not practical for us to fix ourselves, I will be hold personally responsible for choosing a solution I don't have any particular reason to believe would work. And this would be the proper thing to do, since behaving in such a way would not be professional, but indulging in my personal desires to do my job in a fun way and overlook serious problems.

I realize that you don't have similar trust to the Rails core team and the community in general as you might have in Oracle Corporation itself. Having said that, by not logging a ticket for those issues you're aware of you're not increasing the chance that those issues will be solved.

What's this "Oracle connector", by the way? Are you talking about ruby/OCI8? (Can you tell I'm not too familiar with the native driver stuff...) If I've understood correctly, both ruby-oci8 and Python's cx_Oracle are simply bridges for the OCI client provided by Oracle, right?

Oh, and in the Burton Group telebriefing with Richard Monson-Haefel, David Heinemeier Hanssen, David Geary, and Dave Thomas, David mentioned that they've been in talks with Oracle about them picking up the Oracle driver. Obviously that's just talk right now, but at least there's hope ;)

I'm speaking of the software modules which allow one to query Oracle from Ruby code, such as ruby-oci8, and the two other Oracle connectors. These interface to a Oracle-provided generic C API, some with more success than others. An objective fact (which I don't like very much, but I'm not in the habit of ignoring facts which I don't like) is that PHP has got official Oracle support like this. The Python people out-and-out lie to potential enterprise adopters who need this kind of functionality and tell us that it exists. It's a permanent deathblow to that system in that company when people notice that after putting lots of money into Python development, you find out about these lies and have to still fund costly rewrites in trustworthy languages and frameworks. Unfortunately many people's experiences with Python have taught them to ask these kinds of questions and demand proof before making any kinds of commitments, and severely punish young developers who bring systems such as these into the enterprise without first thinking things through without the rose-tinted glasses and happy-fun-fun Ruby coding.
I'd like to see support for JMS and JMX (not sure how practical it is to use JMX from Ruby, but I'd like to).
Hmm. I gather that's a matter of accessing Java code from Ruby more than supporting JMS/JMX/whateverelseJavaAPI. I wonder if someone already has a "bridge" readily available? And, of course, you could just use JRuby which gives you (most of) the beautiful Ruby language plus all the Java libraries...

I thought about that JMS/JMX thing for a while. Here's what I figured out.

There's rjni which is a binding from Ruby to JNI. With that, you could do something like the following:

reflector = RJNI::Reflect.new
sclass = reflector["com.foo.MyJmsClient"]
client = sclass.new
client.send(:message => "Hello", :topic => "CHAT")

That would require you implementing the JMS client itself in Java but you could then use the Java client from Ruby.

Getting away completely without any Java code between your Ruby code and the JMS provider would mean reimplementing a JNDI client which knows how to deserialize Java objects which would mean reading .class files from the JDK's tools.jar and converting those to Ruby classes, and doing the same the other way around, i.e. writing Ruby objects to a stream as serialized Java objects with all the class versioning intact and all.

Sounds like a lot of work to me, so maybe it would be worth it to try the rjni way first (or just implement a server-side XML-RPC or SOAP service that bridges to the JMS and poll that service with Ruby).

As for JMX, you'd again have to go through JNI or implement Java's RMI protocol in Ruby, or (if your JMX server supports it) the (optional) JMXMP protocol which is built on top of TCP using TLS and SASL for security.

Again, makes one wish someone else has implemented it for you already...

Jon Tirsen just blogged about an apparent solution for the JMS integration.
More here on lack of database stale connection handling.


Add a comment

Title
Body
HTML : b, i, blockquote, br, p, pre, a href="", ul, ol, li
Math Quiz 1 + 7 = (Helps stop blog spam)
Name
E-mail address
Website
Remember me Yes  No 

E-mail addresses are not publicly displayed, so please only leave your e-mail address if you would like to be notified when new comments are added to this blog entry (you can opt-out later).

TrackBack to http://radio.javaranch.com/lasse/addTrackBack.action?entry=1129926322749