2 Replies Latest reply on Apr 1, 2006 4:38 AM by epbernard

    How are entity beans detached?

      How are local entity beans detached? The local session bean uses the entity manager to find and return an entity bean. What mechanism is responsible for detaching that bean prior to returning it to, say , the web tier.

      Corollary: what is the "injection" mechanism? I know annotations trigger them but how's that work exactly?

      Tanks!

        • 1. Re: How are entity beans detached?
          bill.burke

          entities are detached from entitymanager at end of transaction with a transaction scoped entity manager. If it is an extended entity manager, then the entity remains managed. EntityManager.clear() also detaches all managed entities, but you lose an unflushed changes.

          • 2. Re: How are entity beans detached?
            epbernard

            Just a few additions:
            - on a EXTENDED PC, the PC is destroyed when all SFSB involving with this PC are destroyed.
            - if the transaction is rollbacked, the PC is cleared