Pregunta

I am pretty new to Java beans and I would like to know it is possible to create a EJB both as Stateful and Stateless depending on the situation.

The concrete case is: I have a DAO EJB that depending on where it is used must have a extended persistence context or not, o I understand it must be Stateful or Stateless depending on the case.

Any ideas?

Thanks! :)

¿Fue útil?

Solución

Ejb can not be a statefull and stateless ejb at the same time.But I have one idea. you can create another class and interface,let it extends the ejb and interface above,if the above is stateless,then mark the second as stateful,else the opposite.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top