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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -