[weld-issues] [JBoss JIRA] Commented: (WELDSERVLET-6) Conversation should work on AppEngine

Matija Mazi (JIRA) jira-events at lists.jboss.org
Wed Apr 21 06:39:10 EDT 2010


    [ https://jira.jboss.org/jira/browse/WELDSERVLET-6?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12526750#action_12526750 ] 

Matija Mazi commented on WELDSERVLET-6:
---------------------------------------

I have an application that is configured as detailed in http://relation.to/Bloggers/WeldJSF20AndGoogleAppEngineNavigatingTheMinefieldPart1 . A Conversation is used like this:

@ConversationScoped
@Named
public class Registerer implements Serializable
{
   private User user = new User();
   private Conversation conversation;

   @PostConstruct
   public void init()
   {
      conversation.begin();
   }

   public User getUser()
   {
      return user;
   }

   public View next()
   {
      // First step: user's fields have been partially populated from a web form
      return register2;
   }

   public View saveUser()
   {
      // Second step: user's fields have been fully populated from a web form
      conversation.end();
      // save user
      return home;
   }

   @Inject
   public void setConversation(Conversation conversation)
   {
      this.conversation = conversation;
   }
}

There are two relevant views, register and register2, both showing a form for entering a part of user data. This works as expected with Weld from trunk, but throws an exception (a Google's Exception complaining that threads are not allowed) with Weld 1.0.1-Final. I tested this only in the development GAE server.

As far as I can see from code, scheduleForTermination() in AbstractConversationManager can only be called if asynchronous has been set to true, which it is not by default. Does your application somehow set this flag?

Implementing a ScheduledExecutorService that uses the Google task queue is probably a good idea but I think it belongs to a separate Jira issue.


> Conversation should work on AppEngine
> -------------------------------------
>
>                 Key: WELDSERVLET-6
>                 URL: https://jira.jboss.org/jira/browse/WELDSERVLET-6
>             Project: Weld Servlet
>          Issue Type: Feature Request
>         Environment: Google AppEngine 1.3
>            Reporter: Paul Bakker
>            Assignee: Matija Mazi
>            Priority: Optional
>
> Weld works pretty well on GAE, which is of course great in combination with JSF 2. The only problem I've ran into so far is that conversations don't work. GAE doesn't allow threading, and the cleanup scheduler in Weld brakes this rule. 
> The problem is in org.jboss.weld.conversation.AbstractConversationManager.scheduleForTermination(AbstractConversationManager.java:204)
> This is obviously not a bug, it's just a GAE problem. I'm not sure how this should be solved in a clean way, disabling the cleanup task when running on GAE seems like a bad idea (memory leaks). It might be an idea to create a GAE task queue for cleanup, but this would require  GAE specific code.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list