EJB Resource References and the Spring Framework.

N

nimish.j.shah

I have a project where I have stateless session EJBs, and I am using
the spring framework within the EJBs by extending
AbstractStatelessSessionBean. In my spring configuration file I have
defined a JDBC Datasource by using the JndiObjectFactoryBean. This
datasource is used by many of the EJBs within the project.

My question is:
What's the best approach to setting up the EJBs and the resource
references? If I lookup the jndi directly, Websphere Application
Server throws a message in the log complaining about it. I think that
they all can potentially share the same JVM because they are all
defined in the same deployment descriptor. If I define resource
references on each of the beans for the datasource, if one of the jndi
mappings is changed for the resource reference, it may not behave as
intended because the beans that I retrieve from Spring are singletons
that are shared between the EJBs.

Any ideas or solutions would be greatly appreciated,

Nimish
 
O

ozgwei

because the beans that I retrieve from Spring are singletons
that are shared between the EJBs.

Each instance of EJB has its own application context and its own
"singleton".

So the so-called singleton is not shared between the EJBs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,888
Messages
2,569,964
Members
46,293
Latest member
BonnieHamb

Latest Threads

Top