[JBoss-user] [EJB 3.0] - Re: FetchType.LAZY

2006-01-16 Thread pvanonselen
Check persistence.xml under JBOSS_HOME/server/all/ejb3.deployer/META-INF. When release_mode is on after_transaction it closes the session after each JDBC statement. Resolve problem by uising on_close or just comment the line containing the following line hibernate.connection.release_mode=after

[JBoss-user] [EJB 3.0] - Re: How to implement OneToMany LAZY relationship

2006-01-12 Thread pvanonselen
Am I the only person with this problem? I am using Jboss 4.0.3SP1 and want to use lazy relationships on a ManyToOne relationship. Surely I am not the only one. Could anyone maybe suggest an alternative to use if using the relationship directly is not possible from within a SessionBean. This i

[JBoss-user] [EJB 3.0] - Re: Do Session Beans have to implement an interface?

2006-01-11 Thread pvanonselen
As far as I know you need an interface to be created manually and the container does not create it for your. If you have a nice IDE like Eclipse 3.1.1 you can extract an interface file from your session bean automatically by right clicking on the Session bean and then click on Refractor -> Extr

[JBoss-user] [EJB 3.0] - How to implement OneToMany LAZY relationship

2006-01-11 Thread pvanonselen
How to implement OneToMany LAZY relationship I am getting a LazyInitializationException: no Session. I have read numerous forums explaining that a client application cannot use a lazy relationship. One forum suggested to use two Session methods, one to get the parent object and another to get

[JBoss-user] [Persistence & CMP/JBoss] - Re: CMP EJB findall returns a Proxy object

2005-02-03 Thread pvanonselen
Solution is to use java.lang.reflect.Proxy like this: | | Proxy element = (Proxy) iter.next(); | InvocationHandler handler = Proxy.getInvocationHandler(element); | CreditorBean bean = (CreditorBean) Proxy.newProxyInstance(CreditorBean.class.getClassLoader(), | new Class[] { Credi

[JBoss-user] [Persistence & CMP/JBoss] - Re: RemoteHome returns strange Object

2005-02-03 Thread pvanonselen
Solution is to use java.lang.reflect.Proxy like this: | Proxy element = (Proxy) iter.next(); | InvocationHandler handler = Proxy.getInvocationHandler(element); | CreditorBean bean = (CreditorBean) Proxy.newProxyInstance(CreditorBean.class.getClassLoader(), | new Class[] { CreditorBe

[JBoss-user] [Persistence & CMP/JBoss] - Re: CMP EJB findall returns a Proxy object

2005-02-03 Thread pvanonselen
Sorry I am using JBoss 4.0.1 View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3865137#3865137 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3865137 --- This SF.Net emai

[JBoss-user] [Persistence & CMP/JBoss] - RemoteHome returns strange Object

2005-02-03 Thread pvanonselen
Sorry for reposting but this issue is very important. It will decide if we choose JBoss or another App server like Jonas or Sun app server. The issue is that I create a remote object fine but when I do a findAll on the EJB it returns a Collection. I assume that this findall method should retur

[JBoss-user] [Persistence & CMP/JBoss] - CMP EJB findall returns a Proxy object

2005-02-01 Thread pvanonselen
I am working with XDoclet and Eclipse 3.1 on a JBoss 4.1 server. I have created a CMP Entity Bean that deploys fine and I can findByPrimaryKey with success but when I do a findAll I get a collection of Proxy objects instead of a Remote object. I am doing something wrong? Here is my Bean Code: