More than a year ago I read a very good book (in my opinion at least), Spring Recipes, A Problem-Solution Approach. It had many things which I needed or wanted to try. Just excellent. Well, time has passed and the first book has shown me everything it has to offer. Time for a new good book about Spring. It seems the solution is the new second edition of Spring Recipes which I just received :) First of all, it has been renewed to Spring 3. It has over 1000 pages (ok, it's quite big), but is there any other book which contains so many detailed things about Spring?
keskiviikko 22. syyskuuta 2010
tiistai 21. syyskuuta 2010
AKG K142 HD, new headphones
I just love them. Sound quality is way better than anything I've had until today. mp3:s are not for me (at least not the bad quality ones), not anymore.
[gallery]
[gallery]
maanantai 20. syyskuuta 2010
c3p0, Spring, Hibernate and NoResultException
I was fighting for a while with NoResultException and c3p0:s config because I thought that was the problem with NoResultExceptions I got. While making uutispuro.fi I finally realized it wasn't the source of the problem.
I had a method doing a persist and a method doing a merge which I had surrounded with try and catch ... and of course with a finally block doing an em.close().
The problem was with the queries doing a .getSingleResult(). I forgot that these might throw the error in hand, and if they did, the closing of entitymanager wasn't done.
I had a method doing a persist and a method doing a merge which I had surrounded with try and catch ... and of course with a finally block doing an em.close().
The problem was with the queries doing a .getSingleResult(). I forgot that these might throw the error in hand, and if they did, the closing of entitymanager wasn't done.
try {
Query query = em.createQuery("select query");
return query.getSingleResult();
} catch (NoResultException e) {
log.debug(e);
} catch (Exception e) {
log.error(e);
} finally {
em.close();
}
keskiviikko 15. syyskuuta 2010
My new 13" MacBook Pro
Been using it for more than a month now. Just love it. Compared to the old HP, this one is from an other planet.
Ok, there is only 4GB of memory (would like to double that), but there actually isn't anything else I would like change or add. Compared to the HP (keyboard was terrible, actually two of it's harddrives went zeee, and it just wasn't fun to use) this one is just fun.
Ok, there is only 4GB of memory (would like to double that), but there actually isn't anything else I would like change or add. Compared to the HP (keyboard was terrible, actually two of it's harddrives went zeee, and it just wasn't fun to use) this one is just fun.