Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

ejbLoad(), ejbStore() and the client security information

Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If container decides to use commit option A (entity stays locked), then it does not invoke ejbStore() after the transactions is commited. It also does not invoke ejbLoad() before the next business method, which runs in a new transaction. These two methods (transactions) can be run by different clients.
Any ideas why EntityContext can be used in ejbLoad() and ejbStore() to get security information about THE client? These methods do not look like directly connect to the clients' calls.

Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ejbLoad() and ejbStore() are only used with Commit Option B and C in order to resynchronize the bean�s transient state with its persistent state.

Consider what happens when a client invokes a business method which requires the Container to transition a bean instance from the pooled to the ready state (by invoking ejbActivate()). The Container synchronizes the instance with the DB and then invokes ejbLoad(). As ejbLoad() runs in the transaction context of the business method and also has a client security context, it is therefore possible to obtain obtain client security information and to execute transaction methods from within ejbLoad().

Before the end of the business method, the Container must begin the synchronization process of the DB with the instance by invoking ejbStore(). This method runs in the transaction context of the previous ejbLoad() or ejbCreate() and still has a client security context, so anything you can do in ejbLoad() you can also do in ejbStore().
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic