Hi,
I'm using JBoss 5.0 with JPA for storing my data in a database. However at some point in my code my entities become detached from the persistence context when passing them to a different class.
When exactly do entities get detached? Outside the method scope they were created in? Outside the class? Outside the JAR file they were created in? Or maybe when traversing a remote interface?
More specific: I have an entity which looks like this:
@Entity public class Customer implements java.io.Serializable { @Id private Long Id; private String firstName; [...] }
@Remote public interface CustomerDBAO { public Customer get(Long customerId); [...] }
@Stateless public class CustomerDBAOBean implements CustomerDBAO { public Customer get(Long customerId) { return em.find(Customer.class, customerId); } [...] }
@Stateless public class CustomerFacadeBean { @EJB CustomerDBAO customerDBAO; [...] }