This content has been marked as final. 
    
Show                 8 replies
    
- 
        1. Re: Seam remoting + long-running conversation. Is it possiblmirko27 Apr 6, 2006 4:43 AM (in response to superfis)It does not mark bean as long-running conversation start trigger. 
 You have to start llong-ronning conversation by @Begin annotation.
 This means that no method of this bean cannot be used unless you have started long-running conversation for this bean.
- 
        2. Re: Seam remoting + long-running conversation. Is it possiblsuperfis Apr 6, 2006 4:56 AM (in response to superfis)"mirko27" wrote: 
 You have to start llong-ronning conversation by @Begin annotation.
 This means that no method of this bean cannot be used unless you have started long-running conversation for this bean.
 Sorry for not complete explanation. I've got fiew SFSBs with actions in long-running conversation. First of these methods has @Begin and conversation lasts until remote action invocation (marked by @WebRemote).
 this is my bean:@Stateful @Name( "selectSeat" ) @Conversational( ifNotBegunOutcome = "ERR" ) @Interceptors( SeamInterceptor.class ) public class SelectSeatAction implements Serializable, SelectSeat { private static final long serialVersionUID = 1L; @PersistenceContext( type = PersistenceContextType.EXTENDED ) private EntityManager cinemaDatabase; private Set<Seat> selectedSeats = new HashSet<Seat>( ); @Out( scope = ScopeType.CONVERSATION ) Seat seat; @Begin( join = true ) public String select( String place ) { this.seat = (Seat) cinemaDatabase.createQuery( "from Seat where row || ',' || number = :place" ).setParameter( "place", place ).getSingleResult( ); selectedSeats.add( seat ); return seat.getState( ).toString( ); } @Destroy @Remove public void destroy( ) { } }
- 
        3. Re: Seam remoting + long-running conversation. Is it possiblsuperfis Apr 6, 2006 4:58 AM (in response to superfis)I've put wrong version, correct code is without @Begin( join = true ) line: @Stateful @Name( "selectSeat" ) @Conversational( ifNotBegunOutcome = "ERR" ) @Interceptors( SeamInterceptor.class ) public class SelectSeatAction implements Serializable, SelectSeat { private static final long serialVersionUID = 1L; @PersistenceContext( type = PersistenceContextType.EXTENDED ) private EntityManager cinemaDatabase; private Set<Seat> selectedSeats = new HashSet<Seat>( ); @Out( scope = ScopeType.CONVERSATION ) Seat seat; public String select( String place ) { this.seat = (Seat) cinemaDatabase.createQuery( "from Seat where row || ',' || number = :place" ).setParameter( "place", place ).getSingleResult( ); selectedSeats.add( seat ); return seat.getState( ).toString( ); } @Destroy @Remove public void destroy( ) { } }
- 
        4. Re: Seam remoting + long-running conversation. Is it possiblgavin.king Apr 6, 2006 6:48 AM (in response to superfis)It is possible, and the chatroom example does this. I'll let Shane give a full explanation... 
- 
        5. Re: Seam remoting + long-running conversation. Is it possiblsuperfis Apr 6, 2006 8:11 AM (in response to superfis)After my short investigation (based on chatroom) I know there is necessity to set up conversationId, like: ... SeamRemote.getContext().setConversationId(context.getConversationId()); ... 
 This conversationId comes with response and I can read it from context in callback javascript function. It works (I suppose) only if long-running conversation starts in remote action (like in chatroom) and first time I can read conversationId is right after first remote action invocation. What about long-running conversation beginning in different action bean? How to receive conversationId value, the remote action should be invoke with?
- 
        6. Re: Seam remoting + long-running conversation. Is it possiblgavin.king Apr 6, 2006 8:19 AM (in response to superfis)Get it from a hidden field.... <input id="conversationId" type="hidden" value="#{conversation.id}"/>
 (That's assuming a facelets page, JSP might be a little bit messier.)
- 
        7. Re: Seam remoting + long-running conversation. Is it possiblsuperfis Apr 6, 2006 9:16 AM (in response to superfis)Thank you Gavin very much. It has solved my problem. 
- 
        8. Re: Seam remoting + long-running conversation. Is it possiblgavin.king Apr 6, 2006 9:45 AM (in response to superfis)coo! No problem. 
 
     
    