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 8425075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:10:28+00:00 2026-06-10T04:10:28+00:00

I have a @Singleton session bean. The bean is annotated with @ConcurrencyManagement ( ConcurrencyManagementType.BEAN

  • 0

I have a @Singleton session bean. The bean is annotated with @ConcurrencyManagement( ConcurrencyManagementType.BEAN).

It has a SessionContext injected into it via the @Resource annotation.

Is this SessionContext inherently threadsafe (since it is a container-produced object that is also used in non-bean-managed-concurrency situations), or does my bean have to synchronize on a lock to access and manipulate it? Section 16.15.2 of the EJB 3.1 specification makes no mention of the thread safety of injected EJBContext objects.

  • 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-06-10T04:10:29+00:00Added an answer on June 10, 2026 at 4:10 am

    From a posting by Marina Vatkina on the users@ejb-spec.java.net mailing list:

    EJBContext in non-singleton beans is accessed only by a single thread, so it doesn’t need to be thread safe. If we use the following text in the section 4.8.5 Singleton Session Bean Concurrency, it makes it a developer responsibility to make sure the context is thread safe, if more than one thread can access that singleton instance at the same time:

    “It is legal to store Java EE objects that do not support concurrent access (e.g. references to Java Persistence entity managers or stateful session beans) within the singleton session bean instance state. However, it is the responsibility of the Bean Provider to ensure such objects are not accessed by more than one thread at a time.”

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

Sidebar

Related Questions

I have a normal java bean which is singleton with jms resource like this
Ok, I've got this singleton-like web class which uses session to maintain state. I
I have a singleton bean that is being destroyed when the ApplicationContext is being
I have a singleton Session that I want instantiated at application launch. How do
I have created a Registry class in .NET which is a singleton. Apparently this
I have a @SessionScoped? DAO that's being injected into a Stripes framework Interceptor constructor
Suppose I have a WCF service that is not session or singleton based and
I have a JSF-managed session-scopped bean. It is also a spring component so that
I have the following confguration in my JSF Spring application: <bean id=userSessionBean class=com.vanilla.beans.UserSessionBean scope=session>
Scenario: I have @Singleton UserFactory ( @Stateless could be) , its method createSession() generating

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.