The session isn't closed until you are leaving the request, after your template has rendered. The problem is most likely with your query or your data. Try accessing the values from your component class and you should see that it's still null.
You should also enable logging for hibernate to see exactly what it's loading and what query it's running. if you're using log4j.properties you can try these: log4j.category.org.hibernate.type=trace log4j.category.org.hibernate.cache=trace log4j.category.org.hibernate.SQL=debug and these to your hibernate properties. hibernate.show_sql=true hibernate.format_sql=true Josh On Sun, Dec 6, 2009 at 9:37 AM, blueboy6 <blueb...@gmail.com> wrote: > > My mapping are ok, because yesterday I used eager fetching on all collections > and it worked, I just removed every eager mappings and create criteria for > all one level criteria, problem is when I try to go deeper... > > It seams that problem is that session is closed when I try to fetch data... > It seeams that tapestry is closing hibernate sessions automatically. > > Someone told me to implement open session in view... Any suggestion about > that matter? > > Tnx for your fast answers :) > > > bouil wrote: >> >> Hi, >> >> You should check your mapping to be sure the many-to-one relationship >> between "comment" and "user" is correct, and verify your database table >> "comment" contains an existing foreign key to the user table. >> >> Best thing to do is to run your Criteria in a JUnit test. >> >> Nicolas. >> >> >> Bojan Cincur a écrit : >>> Hi all, >>> >>> I have a little problem. >>> >>> I'm using hibernate criteria to fetch list of objects that I want to >>> display >>> in loop component. (enclosed in my commentModule component) >>> >>> Criteria criteria = getManager().createCriteria(CommentBean.class); >>> criteria.setFetchMode("user",FetchMode.JOIN); >>> >>> this criteria should return list of commentBean objects and associated >>> user >>> object (as said in hibernate documentation), >>> >>> BUT >>> >>> when i call in loop element comment.user.username to optain username of >>> user >>> that posted comment I get this error: >>> >>> Render queue error in Expansion[PropBinding[expansion >>> collaborators/Details:commentsmodule(comment.user.username)]]: Property >>> 'user' (within property expression 'comment.user.username', of >>> me.xxx.xxx.components.commentsmod...@eaabad) is null. >>> >>> I tried all sorts of thing but I'm not sure what to do next... Is this >>> problem with tapestry and is there some sort of work around? >>> >>> >> >> >> >> >> > > -- > View this message in context: > http://old.nabble.com/Tapestry---hibernate-problem-tp26664444p26667111.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org