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.
Stateful and Stateless EJB depending on implementation
-
30-05-2022 - |
Question
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! :)
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow