on 03-10-2009 1:25 PM
Hello,
in need a Example how to use a @Stateful-EJB in WebDynpro(CE 7.1), wich was imported via Model.
I have a EJB, that works Stateful in a normal Java Application Client .
When i call some Methods of this EJB in a WebDynpro-Applikation, than i have always the initial state of the EJB (like stateless). The fist call (Login) works fine. All subsequent calls of Methods of the same EJB acts as when they use a new Instance of my Bean.
What can make wrong ?.
What are the importent things to use the Stateful-EJB correct in a java WebDynpro ?
Are Stateful EJB supported in WebDynpro (CE 7.1) ?.
Thanks for help.
Hi Klemens,
Stateful EJB can be used but not as model.
To use Stateful EJBs in WDJ you must perform explicit lookup of the EJB you need.
Add the following dependency to the WDJ: engine.jee5.facade
add also the dependency to the EAR public part containing the EJB class reference to the EJB DC.
In you component controller do as follows
InitialContext ctx = new InitialContext();
MyBeanLocal consumer = (MyBeanLocal) ctx.lookup(lookupString);
//use the bean
where lookupString is the JNDI name of the EJ bean/interface you need.
This can be found in NWA -> JNDI browser -> find your ejb interface in the tree and then use the Object Name string.
Please remember that stateful ejbs must be killed after usage or the engine will run out of memory.
Award points if this was useful
Thanks, regards
Vincenzo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Satish,
im sorry, but the 4 links has more questions than answers.
Link 3. describes may the same problem, but has still no answers !?.
Is there no complete example for using a Stateful EJB over model import in a WebDynpro (CE 7.1) ??.
Thanks
Best Regards
Klemens Heilemann
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.