Hi Andreas I only have little knowledge of the inner workings of hibernate. But I am using hibernate3 in portlets myself and it works perfectly.
The major difference between your and my environment seems that you're using hibernate directly and I'm using it with spring (springframework.org). Spring provides an "Open Session In View" Filter which opens a session at the beginning of a render cycle and keeps it open until the portlet has finished rendering, so you don't have to manage hibernate sessions yourself. It's just a guess but I think your problem lies somewhere in that area. How about using springs hibernate support along with it's portlet support (still somewhat experimental: http://opensource2.atlassian.com/confluence/spring/display/JSR168/Home). It works very nicely for me. regards Patrick 2005/12/3, Andreas Buechler <[EMAIL PROTECTED]>: > Hi, > > in my portlet I'm trying to access the db over hibernate. Unfortunately > this doesn't seem to be very reliable (at least how I configured it...). > After googeling a little I found out that the "Hibernate Reference > Documentation v3.0.5" isn't quite up to date and that you don't have to > use Tomcat's JNDI-bound JDBC connections anymore [2]. > > My problem is now that it still doesn't work in a reliable way. The > symptoms are that if I access the portlet for the first time the db > query is (mostly) successful. After that I get NullPointerExceptions. To > make sure it's not my hibernate code, I tried the same query in > standalone application (without Tomcat/Pluto). It worked without any > problems. > > Does anybody have a clue what's going wrong here? How did you get > hibernate to work reliable within your portlet? Any hints or suggestions > are highly appreciated! > > > [1] http://www.hibernate.org/hib_docs/v3/reference/en/html/quickstart.html > [2] http://www.hibernate.org/114.html > > Regards, > Andi > > -- "I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
