Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

EJB Resource References and the Spring Framework.

Thread view: 
nimish.j.shah@gmail.com - 13 Sep 2006 23:54 GMT
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
ozgwei - 15 Sep 2006 07:46 GMT
> 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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.