Results 1 to 4 of 4

Thread: Implementing custom session state management

  1. #1

    Default 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. #2
    Join Date
    Nov 2005
    Posts
    113

    Default

    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

  3. #3
    Join Date
    Jan 2011
    Posts
    6

    Default

    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.

  4. #4

    Default

    @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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •