3 Replies Latest reply on Oct 1, 2010 2:35 PM by Vitor Braga

    Scope Conversation problem

    Vitor Braga Newbie


      I could not use properly in any way the scope Conversation :(

      First, I have 3 beans with 3 screens, and they work on a sequel. From first, I go to second, second to the third and I can back too.

      I understood that the scope Conversation saves the screen the way you left it when you left it, until you end the conversation. This was even happening, but here are the problems:

      1) The @Begin only worked when I put[My Link=>] on my method @Create, equivalent to @PostConstruct. When I put in for example a method call when clicked on a link to go to the second screen (the action attribute of it), did not work. I do not understand why :(

      2) Making the workaround above, was working to move from one screen to another, and when he returned was there all cute, but when I would save that second screen, gave the following error:

      A collection with cascade all-delete-orphan was no longer referenced by the owning entity instance

      And just gave it the first time I tried to save, at other times worked right. I could not figure out why. Lack any annotation set to work perfectly? Any help is welcome, just want to improve my code.


        • 2. Re: Scope Conversation problem
          Leo van den berg Master


          I would like to give it a try, but I really need some code/pages, because only with the above explanation I can't do anything.


          • 3. Re: Scope Conversation problem
            Vitor Braga Newbie

            Ok, i've done more tests, and i got this conclusions:

            I am using @Begin to use a conversation between beans, and when I put, I can not save my data. The error is this:

            A collection with cascade 'all-delete-orphan' was no longer referenced by the owning entity instance

            The interesting thing is that just gives this error the first time you try to save, then it works normally ...

            And when I take the note, it works normally.

            I put a button on the page pointing to a method ending the conversation (@End) and when I save it worked.

            Does anyone know what might be causing this?

            The atribute that causing this error:

            @OneToMany(mappedBy = "dog", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
            @Cascade(value = {org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
            @JoinColumn(name="DOG", nullable=true)
            private List<Dog> dogList = new ArrayList<Dog>()

            Im using

            @Begin( join = true )

            on my method to initiate the conversation.

            Remember that couse error only in first time Oo