• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

global parameter for EJBs

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

In the deployment descriptor, where would I store database lookup names (JNDI name) for all EJBs?

I understand that each EJB has a resource-ref entry in DD which it can define resource JNDI name, but if all my EJBs point to the same Database, there ought to be a way globally defining that for ALL ejbs. I just do not know where that is in the DD.

Thanks.
Yan
 
author & internet detective
Posts: 40747
827
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yan,
As you know, you define the datasource on the server. So the real database info is in one place. As far as I know, you need to define the resource reference repeatedly though. In a way this makes sense because different beans could refer to the same datasource in different ways.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At first you should declare reference-ref in your DD. You put some logic resource name. For example 'jdbc/SystemDataSource'. When you deploy EJBs into some application server, you must have vendor-specific descriptor file (in JBoss it is 'jboss.xml'), where you must define exactly what 'jdbc/SystemDataSource' means - to what resources it refferers. In jboss.xml you can write it in 'resource-managers' section. For example:

 
Get meta with me! What pursues us is our own obsessions! But not this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic