Hibernate not suited for normalized databases

On my current project our database is highly normalized to support high volumes of data. We decided to investigate persistence frameworks with a bias towards Hibernate which has a reputation for being the best persistence framework at current. While it is well suited for a situation where you have one object per table (seems like a typical paradigm for web applications), it is not suited for heavily normalized tables.

In the past, I’ve posted about recommending Hibernate (see my JavaLobby article), but couldn’t find a proper use of it in our application. We have several tables sometimes upto three for a given object. Hibernate doesn’t seem to do this. Many have said “Hibernate can handle multiple tables per object” but few have actually explained how to do it. Many have also said, “Why don’t you make use one object per table” because we can’t change our database tables.

We’re going to roll our own mapping and hope for the best. In the process, I will checkout iBATIS as well as OBJ.

Other Hibernate entries

Angsuman’s Blog

If you have examples of an object being loaded from multiple tables and the ability to use hand tuned SQL queries (without the use of HQL) feel free to comment.

Upgrading Fedora Core 1 to Core 2 test 3 (cont'd)

I had blogged on 5/14 that I was going to upgrade to Core 2 this weekend. Well, I actually upgraded that night. I just got the fever to upgrade. So two hours later (5/13 12:30AM), I got Fedora Core 2 Test 3 installed (actually upgraded).

After burning the four ISOs, I inserted disc 1 while still logged on to the system. Fedora auto mounted the drive and prompted me to run the autorun script. I answered yes, and the installer proceeded to list the package it was going to update. I’m not that trusting, so I quit up2date, and rebooted. Though that was nice feature and when GA Core 2 comes out this week, I will probably go that route.

I rebooted using disc 1, not to make the same mistake I made with Test 2, I tested all four discs to avoid any surprises. All the discs checked out and I proceeded to install. The first screen asked whether I wanted to upgrade the current install or install new. I chose to upgrade (this option wasn’t present in test 2). Then I was asked if I wanted to update my GRUB configuration, to which I answered yes.

A dialog appears stating I need all four CDs, personally this should’ve been done before it asked me to update my GRUB setup. Nothing should happen to my system until it has decided I have everything I needed.

It’s now 11:06PM, I click continue to resume the installation resulting in a “Preparing RPM transaction, the Preparing to install” dialogs. The installer states 45 minutes remain (we’ll see to that).

Meanwhile, I decide to read the Release Notes. After 6 minutes, the installer states I have 50 minutes (now it’s 11:22PM). I’m prompted to insert disc 2, then disc 3 is inserted at 11:55PM with only 10 minutes to go. Th installer some how caught up, by 12:01AM, I am prompted to reboot.

This is where the fun begins. I reboot the machine knowing I won’t see the graphical boot because of the NVIDIA driver I had installed.

Every time I upgrade the kernel, I have to rebuild the stupid driver. This is where Windoze is much better than Linux. I shouldn’t have to rebuild my drivers when I upgrade the kernel, I understand why technically it must be done. But a user shouldn’t have to worry about this. They just want the machine to automagically work, especially during an upgrade. I would’ve preferred that the installer stated, “You are running the NVIDIA proprietary driver, in order to guarantee stability, we will use the supplied NVIDIA driver”. This way the graphical boot would’ve worked immediately upon reboot, allowing the user to reinstall the proprietary driver later (if needed at all).

After attempting to reinstall the NVIDIA driver (which didn’t work with the 2.6 kernel, I reverted to the supplied nv driver). This is totally NVIDIA’s fault, not Fedora‘s. So don’t count this against the Fedora.

Once I fixed the driver issue and rebooted, the graphical boot appeared. Then two other drivers failed, the twoos2two virtual machine driver failed, as did my cisco vpnclient driver, both of which need to be recompiled for the new 2.6 kernel. Again, this shouldn’t have to be done.

I got to the login screen, bear in mind that my custom GDM theme was replaced by the default Fedora Core 2 theme which was a bit annoying for an “upgrade”. I logged in, whew my users are still defined 🙂 All of my themes are still there so at least that wasn’t messed with. But a dialog appeared with the error “XKB config error”. So a quick Google search for “XKB config error” I had to replace “xfree86” with “xorg” in my /etc/X11/XF86Config file. NOTE: removing the line didn’t help as stated in on of the posts. Another reboot, and viola. I’m running Fedora Core 2 Test 3.

The upgrade when far smoother than I anticipated. The three driver problems I anticipated since I’ve had them before after updating my kernel in Core 1. The XKB was new, but simple to fix.

Upgrading Fedora Core 1 to Fedora Core 2 test 3….

I’ve just finished burning my 4 ISOs of Core 2 test 3. I’m going to upgrade my Core 1 installation, I’m dynig to try out the new GNOME with Nautilus upgrades as well as the 2.6 kernel.

Seeing as it’s 10:30 PM EST, I’m going to put this off until this weekend. I will post with detailed experiences.

Linux Tip of the Day

I use df a lot but found it’s output useless. And I never thought of figuring out how to change it. So I decided to RTFM (man df). And viola! there’s the “human readable” format.

df gives you:

]$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda3             36235016   4115460  30278912  12% /
/dev/hda1               202220     25127    166653  14% /boot
/dev/hdb1             38448276   4447508  32047668  13% /home
none                    514016         0    514016   0% /dev/shm

df -Th gives you:

]$ df
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/hda3     ext3     35G  4.0G   29G  12% /
/dev/hda1     ext3    198M   25M  163M  14% /boot
/dev/hdb1     ext3     37G  4.3G   31G  13% /home
none         tmpfs    502M     0  502M   0% /dev/shm

I aliased df to df -Th in my .bashrc (alias df=’df -Th’). Now when I type df, I get the nice output.

Adan makes up new joke

Yesterday while visiting Abuelo y Abuela, Adán made up his first knock-knock by himself. It goes like this:

Knock Knock
Who’s there?
Hair
Hair who?
Haircut!

This was very interesting to us since he just finished getting a haircut. And we see he understands patterns at the meer age of 2.5. Liz & I are so amazed.

Drivers

I have several pet peeves with other drivers (I’m sure they have some with the way I drive, but it’s my blog so who cares).

If there is a merge lane, use it. Do NOT stop at the beginning thinking you’re going to be able to generate enough speed to get onto the highway.

If there is a shared turn lane, move into the lane and slow down. Don’t slow down in the main lane of traffic.

Here in the South, drivers are courteous (which is nice compared to the ones in DC), but they are overly courteous. For instance, the other night going home, there was a person waiting to turn out of a shopping center. I was in the right lane behind several cares that were stopped. The left lane was moving just fine. I noticed the person turn out of the shopping center. And thought, someone must’ve let her in because all the cars in front of them were stopped and there’s no place to go. WRONG! The person several cars in front of me had stopped traffic in the main road to let this person in. This goes beyond courteous to dangerous! ARGH!

Sending plain text emails using Thunderbird

Personally, I dislike HTML email. I think email should be text only and want to use Thunderbird to send out plain text emails. Out of the box, Thunderbird is setup to send HTML formatted emails.

Start Thunderbird
Click Tools -> Account Settings
Click on Composition & Addressing
Uncheck “Compose messages in HTML format”.
Click OK

Now click Tools->Options
Click Composition
Change “Forward messages:” to “Inline”
Click OK.

That should take care of it. Now you can send out plain text emails.