Transparent lazy loading across client - server boundaries is not a trivial
problem. There's been a lot of discussion on this (on the Spring and
Hibernate lists) and suggestons of using a smart proxy but there's no
implementation of those concepts. Are you sure that Toplink was able to
provide transparent lazy loading across JVM's? If so, you should probably
stick with using toplink (and I'll check it out too).

Sanjiv

On 6/28/07, MarcelR <[EMAIL PROTECTED]> wrote:


Ok thanks, I will try that. But actually I would like to use the lazy
initialisation.
Last months I've used that with toplink without any problems.
But want to use in my new project appfuse2's core and JPA (so hibernate's
jpa implementation).

I also tried to a change from jpa-hibernate to hibernate (in pom.xml) and
with that it just worked.
Why are in that case the session's not closed?

So what I can do is change to hibernate. But in that why my projectteam
has
a little higher learning curve (because they now how to use JPA).

I will try the first, but also hope there's a solution to use it like with
Hibernate.

Marcel



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#a11341709
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to