[jboss-user] [JBoss Seam] - Getting "Entity not managed" when using EntityManager in ses

liudan2005 do-not-reply at jboss.com
Sat Jan 27 12:05:12 EST 2007


My EntityManager is injected to my session scoped and I have 3 methods:

  | @PersistenceContext(type = EXTENDED)
  | private EntityManager em;
  | 
  | public String list(){
  | ...
  | }
  | 
  | public String edit(){
  | ...
  | }
  | 
  | public String save(){
  | ...
  | }
  | 

In list method, I retrieve a collection of data from db. in edit(), I start to edit for a single entity. in save(), when I try to use em.persist(myentity) or em.merge(myentity). I get java.lang.IllegalArgumentException: Entity not managed.

If I change my ejb to conversation scoped, the problem would disappear. Any idea?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007218#4007218

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007218



More information about the jboss-user mailing list