[jboss-user] [EJB 3.0] - Entity collection problem.
urswag
do-not-reply at jboss.com
Thu Aug 17 10:17:36 EDT 2006
Entity collection problem.
Hello
I try to get a many relationship collection of the Enitty language. Unfortunately I get an error message.
anonymous wrote :
| @OneToMany(cascade={CascadeType.ALL})
| @JoinColumn(name="langid")
| public Collection getAssortments() {
|
| return assortments;
| }
|
| public void setAssortments(Collection assortments) {
|
| this.assortments = assortments;
| }
|
anonymous wrote :
|
| used by: java.lang.reflect.InvocationTargetException
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:400)
| ... 56 more
| Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.flohmarkt.ejb.Language.assortments, 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.PersistentBag.size(PersistentBag.java:222)
| at org.flohmarkt.web.WelcomePage.getLeftOverviewList(WelcomePage.java:69)
| ... 61 more
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965769#3965769
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965769
More information about the jboss-user
mailing list