Friday, May 20, 2011

HSQLDB 2.0.0, BLOB & Hibernate

[See this post in the new blog]

HSQLDB is a very nice and complete all-Java DBMS, particularly useful when doing quick test-outs or maven tests.

A while ago, a bug has been discovered in release 2.0.0 that is causing issues with BLOB management: this is a considerable issue especially with @Lob fields in Hibernate.

The bug was actually fixed in 2.1.0; latest stable release is by today 2.2.1.

Unfortunately, the latest release available at the Maven Central Repository is "only" 2.0.0. [Update: release 2.2.4 is now available (June 25th 2011)]

Taking inspiration from this StackOverflow question, I've elaborated a simple solution working for Hibernate.

First of all, create a simple Java class like as the following:

public class HSQLSafeDialect extends HSQLDialect {

    public HSQLSafeDialect() {
        super();

        registerColumnType(Types.BLOB, "longvarbinary");
        registerColumnType(Types.CLOB, "longvarchar");
    }
}

Then configure your Hibernate instance to use xxx.yyy.HSQLSafeDialect instead of standard org.hibernate.dialect.HSQLDialect.

Basically, this disables BLOB and CLOB supported introduced as new in  HSQLDB 2.0.0, reverting to 1.8.X style.
Not fancy, but enough to make your maven tests run smoothly. Enjoy.

Wednesday, March 9, 2011

Still surprised by Linux? Yeah :-)

[See this post in the new blog]

Yesterday evening I had to print out a photo of my son: since the only ready PC in the neighbourhood was my brand new Linux powered laptop, I just plug in the USB cable of my HP Deskjet F300 all-in-one.
Without paying any attention, I switched it on, being prepared to go through the usual CUPS story, when some popups on the bottom right of my KDE desktop appeared saying that scanner and printer were been successfully configured. Just a quick test to verify that everything was actually working and voilĂ . Great!

I still remember what, years ago, I had to do to make my old Epson Stylus Color 740 able to operate, and without any success guarantee: modprobe, lsusb, /var/log/syslog, dmesg...

Apache Cocoon PMC Member!!

[See this post in the new blog]

After very good news I have reported before, this morning I have received a very pleasant e-mail saying that since today I have been accepted as member of the Apache Cocoon PMC.

Wow, I am still astonished by all this new stuff :-)

Wednesday, March 2, 2011

Apache Cocoon committer!

[See this post in the new blog]

Yes, it's true - I am still realizing, but it's definitely true:since last February 21st 2011 I have been granted committer rights at Apache Software Foundation, on the Cocoon3 project.

As I wrote to PMC members, it has been a real honour for me to accept this proposal and I wish I'll be able to contribute this project at best of my capabilities.

If you want, and especially if you don't believe me ;-) take a look at my personal page at people.apache.org!

Monday, February 28, 2011

Linux Mint 10 KDE on HP Envy 14 1100

[See this post in the new blog]

I come from four-in-a-row (very good) laptops made by mummy Apple: an iBook G3, a Powerbook G4, a MacBook Pro Core2Duo and another shining MacBook Pro, powered by dual-core i7 and SSD.
Because of some relevant changes in my work life (I'll write something about it in the near future), I had to return to my former company the latest laptop - with some regrets, however, it's a damn powerful machine.

Of course I could buy another MacBook Pro, maybe one of the latests, like some of my colleagues is doing right now, but it's been a few months now that I have a growing uncomfortable feeling of Apple and MacOSX that resemble every day to a cage, with their Apple Store, bells and whistles.

So I decided: back to the roots, back to Linux, possibly Debian, like when I was younger and I met THE Linux guy: I am expecting possibly more headaches, but I am free again, and nothing else matters.

After some discovery throughout the whole Internet, I've found this HP Envy 14 1100: solid, elegant and powerful; here it follows some hardware key points:
  1. Intel® Core™ i7-720QM 1.6 GHz (2.8 GHz with TurboBoost™)
  2. 4 GB DDR3 in a single slot; another slot free for additional 4 GB
  3. 500 GB (7200 rpm) SATA Hard disk
  4. ATI Mobility Radeon™ HD 5650, 1 GB dedicated memory
  5. LED 14,5'' display (1366 x 768)
General notes
  • Most of information here could by applied with minor modifications to other laptops of the HP Envy family
  • Most of information here could by applied to one of *Ubuntu 10.10
  • The Realtek network card has some issues with its deep sleep mode: be sure to read this post before starting any activity related to Linux installation; if it's too late (you easily jumped over this point and are now scrolling back to find out why you have that issue), please read how to remove the memory in order to reset the motherboard.
  • The laptop comes with four primary partitions on disks, so there is no way to make additional partitions for Linux unless you remove the HP recovery partition.
  • Other general information about installing and running Linux on a similar hardware were found here and here.
Installing Linux Mint KDE 10

Ok, Linux Mint it's not Debian, it's an Ubuntu derivative, and Ubuntu is in turn a Debian derivative. But Linux Mint has an ongoing pure Debian edition that will eventually replace the current one.
About the desktop environment, since 1.0 I've always preferred KDE over Gnome: I've always felt it more organic and stable.

As first step, download the bootable DVD ISO image from Linux Mint website, then burn a DVD and keep it ready for re-partitioning your hard drive.

Then, make all necessary backups and preparations, as reported in this guide about using GParted to resize Windows 7 partition, and keep a safe copy a Windows 7 repair disc.

Finally, reboot your system with the Linux Mint KDE 10 DVD inserted (you have to enter in the BIOS at poweron in order to select to boot from DVD drive) and let everything roll on.

The installation procedure runs quite smoothly, with some relevant items:
  • after resizing the Windows 7 partition (having removed the HP recovery as specified above) make a logic partition in which some additional extended partitions need to be created;
  • right after first boot, install the proprietary drivers for display card (ATI Radeon HD 5650) and wireless adapter (Broadcom BCM43224) by running jockey-kde from command-line (or "Additional Drivers" from the menu);
  • you might prefer to use an external USB mouse since the touchpad - a Synaptic Clickpad with promising features in gestures - is almost unusable; the situation improves significantly by applying this advice: I have now left click, two-finger scrolling and right click features (via two-finger tap, right button is still not working);
  • in order to profit from using an external monitor, you need a "HP mini displayport to VGA" or "HP mini displayport to DVI" adapter (similar Apple adapters won't work);
  • suspension and hibernation work by default, but you need some tweaking in order to be able to suspend/resume more than once: edit /etc/default/grub and add "usbcore.autosuspend=-1" to GRUB_CMDLINE_LINUX, then issue a "sudo update-grub".
Finally, if you want to verify that your system is actually using its Intel Core i7 at best of its power, just download i7z from googlecode, compile and run.