keskiviikko 22. syyskuuta 2010
Spring Recipes, second edition
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?
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.
sunnuntai 9. elokuuta 2009
Visiting Den Haag/Scheveningen
At the beach in Scheveningen.








maanantai 6. heinäkuuta 2009
Spring controller and redirecting
Two ways to use redirecting. First one uses the url mapping configured in an xml file. The url seems to be the same for the client (or actually is, depends on the situation). The second one tells the client to redirect to a certain page, so the url in the client changes accordingly.
1. Use the Spring url mapping
2. Tell the client to go to a certain page
1. Use the Spring url mapping
Map model = new HashMap();
model.put("article_id", "get it from db?");
return new ModelAndView("article", model);
2. Tell the client to go to a certain page
return new ModelAndView(new RedirectView("index.jsp"));
sunnuntai 5. heinäkuuta 2009
Dom tower of Utrecht and Amsterdam train station
Dom tower of Utrecht 4.7.2009 and Amsterdam train station 5.7.2009.

Tilaa:
Blogitekstit (Atom)