java - Can I call from one ejb3 session bean method to other method in same session bean ? -


can call 1 ejb3 session bean (statless/statefull) method other method in same session bean ? state of members save between calls ?

yes, can. use @resource sessioncontext inject instance, , use getbusinessobject (or getejbobject or getejblocalobject depending on view want); see javadoc methods.

for stateless beans, invocation on new bean instance. depending on you're trying do, can simpler use @ejb yourinterface directly inject proxy rather using sessioncontext.

for stateful beans, state of bean "preserved" because you'll invoking same underlying bean instance.


Comments

Popular posts from this blog

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -