Announcement Announcement Module
No announcement yet.
EJBContext in application context Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • EJBContext in application context

    I have an existing EJB application that uses the EJBContext to get the user id of the caller and marking the transaction for rollback. It doesn't use the EJBContext but through a service that references the EJBContext. I would like to use Spring IoC for parts of the application.

    The problem according to the EJB specification
    16.15.1 Bean Providerís Responsibility

    EJBContext objects accessed through the naming environment are only valid within the bean instance that performed the lookup.
    Which forces me basically to have an application context per EJB instance. Is there any way to get around this if I want to share an application context between EJB instances? The only thing that comes to my mind are interceptor and thread local hacks.