-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: SessionClosed, EntityManager
PostPosted: Tue Aug 07, 2007 7:15 am 
Newbie

Joined: Thu Jun 21, 2007 9:24 am
Posts: 7
Hello, I have:

Code:
@Stateful
@Scope(ScopeType.SESSION)
@Name("project")
public class Project implements ProjectLocalIF {
  @PersistenceContext
  private EntityManager em;

  ...
}


There are beans with OneToMany and ManyToMany EAGER fetching.
I want to LAZY fetching but:

When I try to access attributes LazyInitialization is thrown (session closed).

But I don't close any session - I work only with EntityManager inside statefull bean.

Can somebody give some point or idea.

Thank you very much


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 07, 2007 11:02 am 
Newbie

Joined: Thu Jun 21, 2007 9:24 am
Posts: 7
Similar threads:
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066873#4066873
http://osdir.com/ml/user-groups.ajug.members/2007-01/msg00035.html

Code:
16:57:15,093 ERROR [LazyInitializationException] failed to lazily initialize a collection of role: cz.test.specializationBeans, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: cz.test.specializationBeans, no session or session was closed
        at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
        at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
        at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97)
        at org.hibernate.collection.PersistentSet.isEmpty(PersistentSet.java:146)
        at org.apache.commons.el.EmptyOperator.apply(EmptyOperator.java:134)
        at org.apache.commons.el.UnaryOperatorExpression.evaluate(UnaryOperatorExpression.java:163)
        at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:383)
        at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:1075)
        at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:189)
        at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:98)
        at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
        at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:442)
        at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:216)
        at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:98)
        at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
        at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:442)
        at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:419)
        at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:440)
        at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:419)
        at org.apache.myfaces.shared_impl.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:75)
        at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
        at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:442)
        at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:216)
        at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:98)
        at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
        at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:442)
        at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:419)
        at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:440)
        at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:419)
        at org.apache.myfaces.shared_impl.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:75)
        at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
        at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:442)
        at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:216)
        at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:98)
        at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)



Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.