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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:18:39+00:00 2026-05-28T00:18:39+00:00

Im trying to get my head around CDI and EJB and the Entity Boundary

  • 0

Im trying to get my head around CDI and EJB and the Entity Boundary Control (ECB) pattern. My understanding of the ECB pattern is that the Boundary is the start and end of the transaction boundary. Further to that, CDI doesn’t provide transaction support like an EJB does.

So if I want to implement the ECB pattern successfully, then the following are true;

  1. I can Implement the Boundary portion with EJB’s (i.e. @stateless, @stateful, @singleton) and the Control layer with CDI or EJB’s.
  2. I can Implement the Boundary and Control portion with CDI but implement transaction support in the Boundary similar to (http://smokeandice.blogspot.com/2009/12/cdi-and-declarative-transactions.html)
  3. I can not implement the Boundary with CDI and then start using EJB’s in the Control layer.

Thanks

  • 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-28T00:18:40+00:00Added an answer on May 28, 2026 at 12:18 am

    I sucessfully implement the ECB pattern in JavaEE 6 using EJB’s solely for the Boundaries and CDI for the Controllers. A typical stack in my architecture uses

    • Stateless EJB’s annotated with JAX-RS annotations to implement a REST service as Boundary
    • CDI managed beans for business logic in the @Dependent scope as Controller
    • CDI managed beans in the @Dependent scope for Data Access Objects which use JPA’s EntityManager to interact with a database
    • JPA entity beans

    The stateless EJB’s which form the Boundary are always annotated with @TransactionAttribute(REQUIRED) which is the default. I do not use other transaction attributes. Doing so, you can ensure that every interaction with the Boundary takes place in exactly one transaction.

    By using only the @Dependent scope for the CDI managed beans, you can ensure that every thread has its own instance of that beans. So you have never more than one thread accessing a CDI managed bean at the same time. Doing so prevents you from the typical concurrency issues.

    Using a combination of more heavy weight, pooled EJB’s for the Boundary and lightweight CDI managed beans for the rest of the application performs very well for me.

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

Sidebar

Related Questions

I was trying to get my head around XAML and thought that I would
Im trying to get my head around the entity framework 4.1 codefirst approach for
Im trying to get my head around the sequence of events that happen between
I'm trying to get my head around the usage of the factory pattern, when
trying to get my head around Feedzirra here. I have it all setup and
Just trying to get my head around Generics by reading this enlightening article by
Just trying to get my head around what can happen when things go wrong
I'm trying to get my head around why the following doesn't work. I have
I'm trying to get my head around the Error Handling in MVC. What I'm
I'm trying to get my head around mutable vs immutable objects. Using mutable objects

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.