[jboss-user] [JNDI/Naming/Network] - Re: JNDI lookup for Data source

jaikiran do-not-reply at jboss.com
Mon Nov 20 07:43:11 EST 2006

You are right, the resource-ref are mentioned per EJB. But those resources can still be used across EJBs. I think this is determined by the res-sharing-scope(which can take values 'Sharable' or 'Unsharable') attribute inside the resource-ref element. The dtd will provide more details. By default this value is Sharable which i guess means that the resource can be accessed across the EJBs.

anonymous wrote : 
  | When looking up such resources, out of the following two way which is the best practise?
  | lookup gicing full path
  | ctx.lookup("java:comp/env/something/something");
  | or
  | lookup giving only relative path
  | ctx.lookup("something/something"); 

The second one is not going to work. When you specify a resource-ref, the objects will be bound in the java:comp/env namespace. So unless you specify that prefix, the lookup code will not be able to retrieve that object for you.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987274#3987274

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987274

More information about the jboss-user mailing list