Announcement Announcement Module
Collapse
No announcement yet.
Implementing custom session state management Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Implementing custom session state management

    Can someone point me to example implementation for custom session state management ?

    I am looking for following approach "keep all the session state in database and keep only the keys in HttpSession object. "

    Can it be done using Spring ?

    TIA
    -Vin

  • #2
    I am looking for following approach "keep all the session state in database and keep only the keys in HttpSession object. "

    Can it be done using Spring ?
    Not without a LOT of work. To be honest, I don't know ANY web frameworks that support this out of the box. Keep in mind you'd basically be overriding the underlying Java Servlet stuff to do this, which is pretty nontrivial.

    Something else to be aware of: performance for this is going to be pretty awful. Database access is always going to be slower than in-memory, and you're basically suggesting one database operation PER SESSION VARIABLE.

    Many app servers have ways to set up to save session data (so it survives a server restart). You'd be much better leveraging that and normal in-memory sessions rather than trying to create a new database web scope.

    Hope this helps
    - Don

    Comment


    • #3
      Check out these links in tomcat:

      http://tomcat.apache.org/tomcat-6.0-...ter-howto.html
      http://tomcat.apache.org/tomcat-6.0-...g/manager.html

      I think you are looking for the JDBC Based Store. This can be configured so that the information in the session is in memory only for the life of the request. Then the next request, from ANY server in the cluster, will retrieve the session info. It stores the session object as a large serialized blob of data.

      Comment


      • #4
        @DON - yep, I understand that but due to some strange reasons JDBC session replication in-built in weblogic is not working for me. so I thought I will give it a try ...

        one more thing the objects stored in webflow's flowscope/conversation scope will inherently use http session object .. correct me if I am wrong

        @Amezick - using tomcat is not an option for me.

        Comment

        Working...
        X