[jboss-user] [JBoss Seam] - Re:

Andreh do-not-reply at jboss.com
Thu Dec 7 19:03:20 EST 2006


I'll try to explaim better !

MyEntity:

  | 
  | @Entity
  | @Scope(SESSION)
  | @Name(users)
  | public class UserEntity implements Serializable {
  | 
  |    //variable and setters and getters
  | 
  | }
  | 
  | 

My Action Register:


  | 
  | @Stateless
  | @Scope(EVENT)
  | @Name("register")
  | public class RegisterAction implements Register {
  | 
  |     @In 
  |     UserEntity userentity;
  | 
  |     @PersistenceContext
  |     EntityManager em;
  | 
  |      public String register(){
  | 
  |            //some if's and here
  |            em.persist(userentity);
  |         
  |           return "/anotherpage.seam";
  |      }
  | }
  | 

and in my jsf page

  | <h:commandButton value="Register" action="#{register.register}" />
  | 


So, I persist one Object, and It is Ok, but if I turn back and go to persist another one, I get that Exception above... I know that's because my UserEntity hava SESSION scope... 

Do I have to change the UserEntity Scope to Event? and modify somethings to make it work properly?

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

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



More information about the jboss-user mailing list