1 Reply Latest reply on Nov 6, 2007 7:09 AM by Chris Paton

    EJB 2.x CMP and EJB 3.0 JPA Coexistence

    Chris Paton Newbie

      Hi there,

      I'm a current user of EJB 2.x running on JBoss 4.0.4. My organisation are starting to upgrade to JBoss 4.2.x and we're looking to move our application to EJB 3.0.

      I've already done considerable research on EJB 3.0, and in particular migration strategies from 2.x. I'm satisfied that we will be able to migrate our session beans gradually by preserving our [Local]Home interfaces so that 2.x clients can continue to use the 3.0 beans.

      However, one thing that I've not been able to find a definite answer to is how well EJB 2.x and EJB 3.0 entities coexist. In particular: if I have an EJB 2.x CMP "Customer" entity, and I perform operations on it to manipulate the underlying Customer table, what happens if I concurrently use the JPA EntityManager to also manipulate the Customer table? Do CMP and JPA use the same transaction service (JTA?) and operate as if I was simply using two CMPs, or two EntityManagers? Or do the two opposing persistence mechanisms conflict with each other in some way?

      Your advice, or any resources you can point me to, would be much appreciated.

      Chris Paton