Hi There,
I am having some problems with managing session in my GAE app.
Although the sessions on the Eclipse SDK runs well, on the real App
Engine the session data does not persist. There are two class objects
that I am trying to store in a session attribute. One is a simple
string and the other is the one mentioned below. But both of them are
not getting saved in the session.

@PersistenceCapable(detachable="true")
public class Agent implements Serializable{

        @PrimaryKey
        @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
        private Long id;
        @Persistent private String name;
        @Element(dependent = "true") private List<Contact> contacts = new
ArrayList<Contact>();
        @Element(dependent = "true") private List<Agency> agencies = new
ArrayList<Agency>();
        @Persistent private List<Long> subAgents = new ArrayList<Long>();
        @Persistent     private Date createdOn = new Date();

}

Here is the servlet code:

        public void doPost(HttpServletRequest request, HttpServletResponse
response)
            throws IOException,ServletException {
                Datastore ds = new Datastore(); //This is a custom class that
fetches the data from datastore
                HttpSession session = request.getSession();
                session.setAttribute("isAdmin", 
request.getParameter("isAdmin"));

                        Agent agent = 
ds.getAgentById(request.getParameter("id"));
                        session.setAttribute("master", agent);
                        session.setAttribute("type","Agent");

                }

I would like to mention again that this runs fine in local SDK, but
doesn't work on production. I get null values for session attributes.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to