• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Questions about DI and JNDI ref

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


I have the following queries related to DI and refering JNDI Names for resources. I would appriciate a detailed explanations to these questions.


1. Can a resource like datasource can be accessed outside the container using JNDI lookup?
2. Why we need to declare the dependency injection at the class level? How container treats this behind the scenes?
3. Since the Global JNDI name(binding name) is verndor specific, what are the best practices of refering to a resource? How these are handled in real time projects?


Many Thanks In Advance,
Ravi
 
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

1.The answer to the point 1, yes, the JPA can be used outside of the business container.
2.I am not shore what do you mean ?
3.In most of the casses when you use DI you don't need to care about the JNDI names, (globales or not) the container does this. But if you need to access the resources from non managed classes you need to use jndi. In this cases you must map the global to jndi names in order to improve the portability.


Regards,
Mihai
 
reply
    Bookmark Topic Watch Topic
  • New Topic