Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6098777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:11:48+00:00 2026-05-23T13:11:48+00:00

I have an EJB3 stateless session bean that uses some other ejbs to do

  • 0

I have an EJB3 stateless session bean that uses some other ejbs to do its work. As I do not want to have all the logic in the ejb class itself, I created some classes which solve the problems. These classes are called by the ejb. To have the referenced ejbs in these classes I created a context object that holds the injected ejb references which is passed to the classes.

My question: is this allowed to store ejb references in simple object fields or must I use some special ejb reference fields? At first glance I can’t see a reason why because everything is handled in one thread an transaction.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:11:48+00:00Added an answer on May 23, 2026 at 1:11 pm

    You can pass these EJB references and store them in these auxiliar classes without any risk.

    Nevertheless, EJB specification encourages you to implement all the logic of your system through EJBs. So, from EJB design philosofy, you should declare these “auxiliar” classes as EJBs also (they perform business logic in the end) and inject into them the needed EJBs references to reduce the coupling (specially if the former EJB doesn’t even use the injected EJBs).

    Again, if you don’t do it and just pass the references manually, no technicall issue should arise.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to code an Stateless EJB3 that uses callable statements, and builds a
We have some staleless EJBs (EJB3) deployed on a GlassFish 2 server that expose
I have seen other thread with similar issue but was not able to work
I have been reading about JPA and EJB3 and would like to confirm that
I have understood that if I use EJB in Spring context, I get all
I have a two Stateless EJB3 beans with bean1 depending on bean2. During deployment
I have a web service (built using jaxb/jaxws) that invokes a stateless EJB to
I have an EJB3 bean deployed as a web service in JBoss 4.2.2. In
I have application written in Java that is using EJB3 + Toplink. I'm using
I am calling a remote stateless session bean from a J2SE application and would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.