I tried both (everything EAGER (actually only an int and String) and Hibernate.initialize() in the constructor of a 'model' POJO). But still get "Session is closed".
Isn't there a way to control the hibernate sessions and open/close them using an aspect advisor like with the transactions? mraible wrote: > > If you're not using a web framework, you should probably not use lazy > initialization. You can use Hibernate.initialize() on your POJO to > initialize all it's children. Either that, or change or FetchType to > EAGER. > > Matt > > On 6/27/07, MarcelR <[EMAIL PROTECTED]> wrote: >> >> I try to use the Appfuse 2m5 core with a Swing UI instead of a web >> interface. >> >> For this generated a core app. (quick start) with a jpa-hibernate as ORM. >> I created a few testcases to test e.g. get(id) and getAll for the >> userDao. >> This works without any problems. >> >> Then when I use a Swing databinding framework the problems start. >> I first tried http://oswing.sourceforge.net/ OpenSwing and after that >> https://genesis.dev.java.net/nonav/3.0/maven-site/en/index.html Genesis . >> But with both I get the same error when I try to use the dao for >> getAll(), >> but NOT for get(id). >> Anybody knows how I can keep the session opened (or how the session gets >> closed). >> Do I need something like >> org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter? >> >> >> Here's the first part of the stacktrace: >> >> org.hibernate.SessionException: Session is closed! >> at >> org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:49) >> at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1110) >> at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) >> at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64) >> at org.appfuse.dao.jpa.GenericDaoJpa.getAll(GenericDaoJpa.java:45) >> at >> com.labiron.masa.swing.companyPart.LoginForm.populate(LoginForm.java:86) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> >> >> I hope anybody can give me some hint to go on. >> >> Marcel >> >> >> -- >> View this message in context: >> http://www.nabble.com/Appfuse-Core-%2B-Swing%3A-Session-is-closed-tf3987393s2369.html#a11321723 >> Sent from the AppFuse - User mailing list archive at Nabble.com. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > -- > http://raibledesigns.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Appfuse-Core-%2B-Swing%3A-Session-is-closed-tf3987393s2369.html#a11358469 Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
