[jboss-user] [EJB 3.0] - Binding the same session bean to JNDI more than once

2008-04-23 Thread ColinEberhardt
Hi All, I want to deploy two distinct instances of my code in the same container. Therefore, I have a session bean (actually quite a few of them) that I want to bind to different JNDI names. Here is how I do it: My EJB3 code is packaged within a JAR file, which is itself packaged within an EAR

[jboss-user] [EJB 3.0] - Session bean as a return parameter

2007-10-05 Thread ColinEberhardt
Just a quick question ... Is it OK for one session bean to return another as the return parameter of one of its business methods? i.e. class SessionBeanOne { public SessionBeanBeanTwo getBeanTwo() } Both are used via their local interfaces. I have tested the above and found that it works.

[jboss-user] [EJB 3.0] - Re: Merge question

2007-03-19 Thread ColinEberhardt
Hi, This has been discussed quite a few times before. See: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=78245 In summary, you must remove the B entity from the collection within A, and invoke em.remove(b) also. The other alternative is to use a Hibernate specific annotation. Regar

[jboss-user] [EJB 3.0] - Re: Deleting parent entity should clear out its foreign key

2007-03-19 Thread ColinEberhardt
Hi, I would not expect the container to behave as you described. From what I understand, it is the responsibility of the EntityManager and the EJB container to save the state of your managed state Entity beans at the end of the transaction. If you wish your child.category property to be null, t

[jboss-user] [EJB 3.0] - Re: Changed behaviour of getSingleResult?

2007-03-16 Thread ColinEberhardt
I cannot comment on what the behaviour was preior to the latest version of JBoss. However it would appear that it is currently operatibng as per the spec: http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html#getSingleResult() Therefore it is behaving as expected! Regards, Colin E.

[jboss-user] [EJB 3.0] - Re: jrxml-file in a EJB3-archive

2007-03-16 Thread ColinEberhardt
Hi, You cannot simply construct a File from a given pathnam ein order to load a file which is packaged within a jar file. Take a look at this page on accessing resources: http://java.sun.com/j2se/1.4.2/docs/guide/resources/resources.html You should try: URL url = Classloader.getResource( "rep

[jboss-user] [EJB 3.0] - Re: Stateless Session Beans - Static Variables - Concurrency

2007-03-16 Thread ColinEberhardt
There are a couple of consequences to your method of caching data: 1. You certainly will hit concurrency issues. Your container will most likely hold a pool of SLSB instances, enabling it to service requests from a number of client. These request may result in concurrent access of your cache dat