Spoiled plans

June 15, 2009
Ah, last weekend we were about to go biking around Loch Leven but bad weather and my flu ruined that plan. Instead the weekend was all about resting - which is not bad for some time. But next weekend should be better.

I also had bad luck with cash ISA (tax free savings account) as I applied for higher rate account but First Direct introduced new lower rates while they were processing my application. I did not like that so I cancelled the opening - luckily I did not send transfer order before that.

But at least now GBP seems to get stronger against Euro. That is good because our trip to Finland is approaching... holiday I say!

Some experiences with JBoss Cache as Hibernate second level cache

May 28, 2009
Previously I did some initial setup for JBoss Cache and now I have tested it a little bit on a cluster setup. The setup has two virtual linux images with JBoss 5. In front of them is Apache HTTP for proxying and load balancing.

I started up JBoss on both machines with -c all. This setup has clustering turned on as a default so instances found each other and established JGroup communication channels. Then I deployed the .ear file directly to the deploy directory on each server as the farm deployment did not look too promising. The Apache proxy and balancer were already correctly configured so cookies and sticky sessions worked fine.

The big question is naturally how the performance improved. First I ran a load test without second level caching or query caching in order to have a baseline for comparisons. Then I turned Hibernate second level cache on and executed the same load test. The results were showing around twofold throughput as the average response times halved. I also tried turning on query caching but I did not experience any significant difference with it. Maybe I did not have proper configurations.

I also learned that it is not a good idea to modify data on the DB used by the cluster with Hibernate second level caching on. The nodes communicate sending invalidate messages to each other when data is changed and needs to be refreshed. Modifications outside the cluster mean that the cached data is stale but nodes do not know about it and resulting various errors...

Hibernate second level cache with JBoss Cache 3

May 25, 2009
The project I have been working on lately is a web application running on JBoss 5. The production setup contains a cluster of JBoss instances behind Apache proxy which acts as a load balancer. So far load testing results have been encouraging and load tests also revealed couple bugs.

Our persistence layer is using Hibernate so the next step in caching was to enable Hibernate's second level cache. There are various options but in our clustered environment JBoss Cache was the choice. But getting started with it took some time.

The easiest way is to use 'all' server setup from the JBoss 5 and enable second level cache in Hibernate settings. The JBoss community wiki page provides an example for the setup. Also your JPA entity annotations or mappings need some changes as well because you need to define caching strategy for them.

Taking a look at the documentation of JBoss Cache reveals huge amount of configuration options. Luckily only some of them are relevant for Hiberante second level caching. Be aware that JBoss Cache has been around for some time so some of the older tutorials and blog posts are outdated. At the moment JBoss Cache version 3.x is the recommended one.

In case of caching it is very important to run proper load tests after each configuration modification to verify the performance gain or loss. At the moment I have my test setup running on Apache JMeter. It creates similar load to the server based on historical usage data. Another area of testing is to verify that cluster's caches are having their state updated properly.

I have been experimenting with JBoss Cache only for a day so it will take a bit more time before I can give my opinion or better advices. So, follow my RSS feed to learn more - hopefully soon there will be an update.

Walkera 4#3b and sauna

May 19, 2009
As mentioned before, I ordered a new toy for myself. This toy is a tiny RC helicopter - Walkera 4#3b. Despite its tiny size and relatively cheap price it has 4 channel controller and it actually flies. Because it is electrical and tiny, it is possible to fly indoors. I did not have any experience with helicopters so I ended up crashing and crashing until I learned how to keep it hovering. Great fun and plenty of challenge!

The sauna in the topic has nothing to do with helicopters. Instead, we found a nice gym in Kirkcaldy and it has a proper sauna. I would pay the membership fee almost just for sauna usage but being able to do some work out is a big plus.

What I have been up to lately

May 05, 2009
I have met some other Finns living in Scotland in couple different events. For some reason most of the other Finns were women married to Scottish men. Maybe Finnish men took Scottish women to Finland - or they avoided them altogether. Anyways, the wappu event organized by Scottish-Finnish Society in Edinburgh was a great way to meet up and taste excellent home made sima.

On the photography front I have taken plenty of photos but I have not spent fortunes on new camera gear. I think the current setup is decent enough and might need only couple minor things. A set of Kenko extension tubes is most likely next thing to get. Obviously the set is never complete, there is always a better lens or camera to buy.

At work it has been busy enough. The project has been progressing nicely and working with GWT/GXT has been a good experience. The most recent highlight was from today as I set up a soft RAID 1 for new hard drives in my Ubuntu dev box. Of course I did not figure out the setup myself, the instructions were clear enough.

Oh yea, I also ordered a new toy for myself. It is still on the way from Hong Kong so have not tried it out, yet...

Biking north along Fife coastal path

April 09, 2009

View Kirkcaldy-West Wemyss-Dysart in a larger map

Management decision making tool

April 08, 2009
Forget SWOT analysis and other nonsense. This is the tool of the future. Well, and past as well...

Social Innovation Camp

March 30, 2009
Today my colleague gave me a leaflet advertising Social Innovation Camp. The idea sounds interesting and most likely I will try to attend because there will be a camp taking place in Glasgow. Now I just need a great idea or two...

New interest and new blog - Apertoire

March 22, 2009
I felt like writing about photographing but this blog is already full of various post about relocation, living abroad and software engineering. Adding photography would mess it up even more. Therefore, I set up Apertoire blog. Feel free to visit it and add it to your favorites.

How to contact software developers in Scotland?

March 16, 2009
Getting to know local people with similar interest both integrates you and improves your skills. Here are couple starting points if you are new in Scotland and you would like to expand your network.

User groups:
Java User Group Scotland
Scottish Developers
Agile Scotland
BCS Edinburgh Branch


Events:
Tech MeetUp
BarCamp Scotland
Developer Day Scotland
Scotland on Rails


There are much more outside this list - so submit your favorite computing related group or event by sending me email or through comments.

BarCamp Scotland 2009

March 15, 2009
Yesterday I attended BarCamp Scotland for a second time. I arrived late so I missed some presentations but otherwise the day was great. This time I did not present anything even though I had a plan to do so. My Selenium presentation's technical demo was not working properly so I decided to skip this time.

I think this year the highlights were Mike Masnick's presentation about 'Business Models for a Digital Era' and after that an interesting discussion about online personal profile management. Time between presentations was spent on networking and I ended up convincing couple fellow developers to try out Selenium. Even though I warned that it is not a perfect tool but it definitely beats writing test cases manually for HttpUnit.

Some photos from the event can be found from my Flicker account under BarCampScotland tag.

Learning Flex

February 28, 2009
After months of GWT and GXT at work I wanted to see how the other side looks like. In my case that would be Flash based rich internet applications. Long time ago I did some experiments with Open Laszló but I did not really get into it.

Now I decided to check Flex so I downloaded free Flex SDK and started with some simple examples and tutorials. Building user interface seems to be quite easy but there are a lot of things I have tried out, yet. Learning server connections using Blaze DS is on my TODO as well as trying out Maven with Flex.

So far Flex seems to be quite easy to get started with as soon as you understand the difference between MXML and ActionScript. The syntax of ActionScript 3 is not too bad for Java programmer. I also bought Flex on Java book from Manning with 50% discount so maybe I end up getting serious with Flex.

Daylight is back

February 22, 2009
Spring is here. In the morning the sun is already up when I go to work. Just couple weeks ago there was snow all around but it is all gone now.

Testing GXT grid with Selenium

February 12, 2009
Grid is a fast and versatile component of GXT. Testing it with Selenium is quite simple but requires couple points to be handled. After some thinking and experimenting I came up with following.

First of all, you will need Firebug or similar tool to inspect DOM created by GXT. A suitable example of Grid is http://extjs.com/examples/grid/grid.html. Simply open that URL and open your Firebug.

We are interested to check that Nokia's stock symbol matches NOK. By inspecting the symbol column cell for Nokia we see something like this:

<div class="x-grid3-cell-inner x-grid3-col-symbol">NOK</div>

We can use the 'x-grid3-col-symbol' as a CSS locator. The syntax in IDE is then 'css=div.x-grid3-col-symbol'. This selects the column but the we should also specify the row.

This can be done by creating a new class extending GridViewConfig and overriding getRowStyle method. This method should return suitable value (for example name from Model). You might want to add a postfix or prefix to the value to avoid conflicts. The value becomes part of the CSS style for the row. Set your own instance extending GridViewConfig to your Grid's using myOwnGrid.getView().setViewConfig() method.

Now you should be able to pin point a specific cell using Selenium locator with two CSS classes: 'css=div.x-grid3-col-symbol div.row_nokia'

One year in Scotland

February 04, 2009
I have spent a bit over a year living here in Scotland. To summarize, I made a list of some problems I encountered during this period. These are not fault of Scotland itself, though.

Water. This basic element came out from the wrong point of the washing machine and a plumber needs to be called. Water also came out from a radiator. And through the roof over a bay window during windy rain.

Electricity. Couple mysterious blackouts in the flat.

Gas. One of the flats was without official gas supply and that wasn't told to me until I started to call up gas companies to find out who is the provider.

Address. Lost address change notification for the council caused extra expenses and head ache. Wrong starting date in the systems of other council required several attempts to get corrected.

Money. Landlady losing banker's draft worth of 1050 pounds, took four months to solve with her and the bank.

Three. Took me a good amount of time and effort to cancel the mobile internet connection during the cool off period.

NHS. Assignment to a GP took several attempts before getting it right Pure lottery in my opinion.

So, couple minor issues but otherwise life has been good.