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
Post a Comment