• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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.

Regards,
Viktor
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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().
 
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic