Help

Controls

PermLinkWikiLink

Built with Seam

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.

Forum: Seam Users Forum ListTopic List
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

2 Replies:
06. May 2008, 17:32 CET | Link

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

07. May 2008, 08:56 CET | Link

this should be mentoined in seam examples

thanks