4 Replies Latest reply on Jan 6, 2014 9:04 AM by sanjmand

    Database persisted sessions for JBOSS 7.1

    sanjmand

      Hi,

       

      I want to use database persisted session in JBOSS7.1 , but i am not getting any article on this.

       

      I have got an article in internet on this for server JBOSS4.0 which contain below steps.

       

      Step 1) We need to make the property "overrideDistributableManager" to false in stadalone.xml file in jboss7.1 server.


      <bean name="WarDeployer" class="org.jboss.web.tomcat.service.deployers.TomcatDeployer"> 

         <!-- "False" disables overriding the session manager for distributable webapps --> 

      <property name="overrideDistributableManager">false</property> 

      </bean>

       

       

      Note: I am not able to find out this entry in standalone.xml

       

       

      step 2) We need to use context.xml in WEB-INF directory of the web application.The context.xml file will contain followin detail.


      <Context cookies="true" crossContext="true"> 

      <Manager className="org.jboss.web.tomcat.service.session.persistent.DataSourcePersistentManager" 

         dataSourceJndiName="jdbc/FinancialClaimSessionDS"/> 

       

      </Context>


      step3)Create a table which has following columns.


      CREATE TABLE httpsessions (app VARCHAR(255) NOT NULL, id VARCHAR(255) NOT NULL,  

           fullId VARCHAR(255) NOT NULL, creationtime BIGINT NOT NULL,  

           maxinactive BIGINT NOT NULL, version INT NOT NULL, lastaccess BIGINT NOT NULL,  

           isnew CHAR(1) NOT NULL, valid CHAR(1) NOT NULL, metadata VARBINARY NULL,  

           attributes LONGVARBINARY NOT NULL,  

      CONSTRAINT app_id PRIMARY KEY (app, id))

       

       

      Can i use the same above steps for the JBOSS7.1 or we have different steps for configuring this in JBOSS7.1.

      Can anybody send me a link or steps where i can get info about this.

       

      Regards

      Sanjeev Kumar

        • 1. Re: Database persisted sessions for JBOSS 7.1
          wdfink

          AS7 and former versions of JBoss are complete different in implementation and configuration.

          So you can't use the configuration from AS4.

           

          I think there is no possibility to add such configuration in AS7

          • 2. Re: Database persisted sessions for JBOSS 7.1
            sanjmand

            Hi ,

             

            According to you, the session cache/ session persisted feature is not there in jboss7.1.

             

            However as per my knowledge , almost every server (weblogic, websphere,tomcat etc) has this feature. If this feature is not supported then how sessions are stored and maintained in jboss7.1?

             

             

            Regards

            Sanjeev Kumar

            • 3. Re: Database persisted sessions for JBOSS 7.1
              wdfink

              It is not specified by the EE spec how a server stores the sessions.

              By default AS7 use a replicated  infinispan cache which store to the local filesystem.

              You might look into the configuration (standalone-ha.xml). Also the cluster how to documentation might helpful.

               

              You can choice several different methods, one is to have a custom-store where you are able to do what you want.

              • 4. Re: Database persisted sessions for JBOSS 7.1
                sanjmand

                Thanks for your suggestion.

                 

                I have gone through the links (cluster how to) sent by you and found that we need to use following entry <distributable/> in web.xml to enable session replication.

                 

                Can you elaborate little more about different method you mentioned in your last post & whether these methods means below methods, in that case I am unable to find out the custom-store.

                 

                Cache Containers

                Local Caches

                Invalidation Caches

                Replicated Caches

                Distributed Caches

                 

                In the above links I am getting below tabs :

                 

                Store,File Store,JDBC Store, RMT Store

                 

                Do I need to put our session persistent configuration in store or JDBC Store in the above tabs.


                Regards

                Sanjeev Kumar