3 Replies Latest reply on Dec 16, 2014 3:45 AM by Jozef Hartinger

    Weld integration question: HTTP session replication and passivation

    Mark Nuttall Newbie


      I'm looking for help integrating Weld into an application server runtime that supports HTTP session replication and passivation. I'm specifically trying to get @SessionScoped CDI beans working properly for simple HTTP requests.In my environment, HTTP session attributes are persisted to a database as each ServletRequest is created and destroyed. The problem that I am seeing is that the HTTP session attributes are not being updated on request destruction, causing the session database to become stale. I expect to be able to restart my application server and have @SessionScoped beans reconstituted correctly, but the values read out through AbstractSessionBeanStore.get(BeanIdentifier) are the values as at object creation - not their most recent state. This is because AbstractSessionBeanStore.setAttribute() is only being called once per session in my environment, and not once per request.


      My question is, are there integration points in Weld that I must implement in order to get HTTP session replication and passivation working? For example, I can see events being fired within org.jboss.weld.servlet.HttpContextLifecycle.requestDestroyed() - is that something that I should be hooking into? There's nothing in the Weld integrator's guide on this topic so I'm not sure how best to proceed.


      Many thanks in advance for any help that anyone can offer me.