3 Replies Latest reply on Jan 2, 2008 12:57 PM by Marcel Kolsteren

    Instances get lost - strange behavior in conversational comp

    Martin Kuhn Newbie


      I've a really strange problem with a Seam Component which scope is "CONVERSATION"

      I read a Entity List (roomList) with JPA in the case the member variable is null --> getRoomList().

      Then I want to hold the instance as long the component exists.

      When I operate on this component from the referencing view everything is o.k.

      But when I change to an other view strange things happen.

      When I return to the former view the Entity List (roomList) is not null but it is not the same as on creation.

      This List has than null entries (as much as the "original" list).
      The component instance is the same.

      public class RoomMaint implements Serializable {
       private static final long serialVersionUID = 1L;
       private List<RoomEntity> roomList;
       private RoomEntity roomEntity;
       private IRoomService roomService;
       protected Log log;
       public void create() {
       log.debug("Create " + getClass().getName());
       public void destroy() {
       log.debug("destroy " + getClass().getName());
       @Begin(join = true)
       public void start() {
       @Factory(scope = ScopeType.STATELESS)
       public List<RoomEntity> getRoomList() {
       if (roomList == null) {
       roomList = roomService.findAll();
       return roomList;
       @Factory(scope = ScopeType.STATELESS)
       public RoomEntity getCurrRoomEntity() {
       if (roomEntity == null) {
       return roomEntity;
       public String save() {
       if (getCurrRoomEntity().isPersisted()) {
       } else {
       return NavigationOutcome.STAY_ON_SAME_PAGE;
       public String remove() {
       return remove(getCurrRoomEntity());
       public String remove(RoomEntity roomEntity) {
       if (roomEntity != null && roomEntity.isPersisted()) {
       return NavigationOutcome.STAY_ON_SAME_PAGE;
       public void select(RoomEntity roomEntity) {
       this.roomEntity = roomEntity;
       public String getDetailState() {
       return ExtendedResourceLoader.getText(isCurrNew() ? "new" : "edit");
       public boolean isCurrNew() {
       return !getCurrRoomEntity().isPersisted();
       public String creation() {
       roomEntity = roomService.createDefaultEntity();
       return NavigationOutcome.STAY_ON_SAME_PAGE;

      When I change the context to "SESSION" it works as expected.

      Could anybody give me a hint what is wrong?