This content has been marked as final.
Show 2 replies
-
1. Re:
pmuir Dec 7, 2006 3:50 PM (in response to andreh)You will have to post some of your code at least. It also sounds like you are confused about the interaction of Seam and Hibernate.
-
2. Re:
andreh Dec 7, 2006 7:03 PM (in response to andreh)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?