0 Replies Latest reply on Oct 29, 2007 3:19 AM by panky_p

    session refresh

    panky_p

      Hi,
      I am trying to add a page in my demo application for that my bean contains

      @Entity
      @Scope(SESSION)
      @Name("myPage")
      @Table(name="my_page")
      public class MyPage implements Serializable {
      
      @Id @GeneratedValue
      @Column(name="page_id")
      private Integer pageId;
      

      and
      @Stateful
      @Scope(ScopeType.CONVERSATION)
      @Name("surveyManager")
      public class PageAction implements PageManager {
      
      @In(required=true)
      @Out(required=true)
      private MyPage myPage;
      @In(create=true)
      private EntityManager em;
      .......
      
      

      and to add page i am using
      public String add(MyPage myPage) {
      try {
      em.persist(myPage);
      em.flush();
      }catch (Exception ex){ }
      }


      When I try to add first page it works fine but when I try to add another page It gives error because of session object it brings old pageId and not the new one I also tried it by making @Stateless but still it wont work, but I need the session should remain and pageId should be new.
      Is it possible??
      Any hints???

      Thanks
      panky_p