You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 9 Members of 6394 |
| Forum: Seam Users |
06. May 2008, 10:52 CET | Link |
I have a question about serialization of stateful EJB.
What happens when bean is serialized and has references to non-serializable fields like EntityManager, Logger (apache, jboss), references to other stateful and stateless beans?
Schouldnl't they be marked as transient?
thanks
EntityManager and beans are marked with standard EJB3 annotations: @PersistenceContext and @EJB. I guess are injected after/before activation/passivation. Rest objected have to be activate/passviate in @PostActivate and @PrePassivate methods which interact with serialization). Also logger... Yes it must be transient and reload in @PostActivate/@Prepassivate (another solution is static logger which wont be serialized, but I prefer not-static)
-- Cheers Kamil
this should be mentoined in seam examples
thanks