Configuring session data storage for the Session-enabled Content Service
Configure Experience Manager to store session data in a dedicated database by editing the Storage Layer configuration files, cd_storage_conf.xml, used by the Session-enabled Content Service. If you have two or more staging environments, you can also configure load balancing.
Procedure
- In the configuration directory of the Role, open
cd_storage_conf.xmlfor editing. - If you intend to run this software component as a microservice, or as a Web application that contains only this software component, remove all references to other databases than the Content Data Store.
- Inside the
<Storages>section, add a<Wrappers>section.Here is an example of aWrapperssection that configures storage for a SQL Server database:<Wrappers> <Wrapper Name="SessionWrapper"> <Timeout>120000</Timeout> <Storage Type="persistence" Id="db-session" dialect="MSSQL" Class="com.tridion.storage.persistence.JPADAOFactory"> <Pool Type="jdbc" Size="5" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" /> <DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource"> <Property Name="serverName" Value="myserver" /> <Property Name="portNumber" Value="1433" /> <Property Name="databaseName" Value="mydb" /> <Property Name="user" Value="admin" /> <Property Name="password" Value="kumquat" /> </DataSource> </Storage> </Wrapper> </Wrappers>And here is an example of aWrapperssection that configures storage for an Oracle database:<Wrappers> <Wrapper Name="SessionWrapper"> <Timeout>120000</Timeout> <Storage Type="persistence" Id="db-session" dialect="ORACLESQL" Class="com.tridion.storage.persistence.JPADAOFactory"> <Pool Type="jdbc" Size="5" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" /> <DataSource Class="oracle.jdbc.pool.OracleDataSource"> <Property Name="driverType" Value="thin" /> <Property Name="networkProtocol" Value="tcp" /> <Property Name="serverName" Value="myserver" /> <Property Name="portNumber" Value="1433" /> <Property Name="databaseName" Value="mydb" /> <Property Name="user" Value="admin" /> <Property Name="password" Value="kumquat" /> </DataSource> </Storage> </Wrapper> </Wrappers>If you are connecting to Oracle RAC, use the property name
serviceNameinstead ofdatabaseName.The
Storageelement in this fragment must refer to your Experience Manager database. - To configure load balancing, do the following:
- In the
<Wrapper>element, add a<MachineName>element specifying a logical name:
The maximum length of the<Wrappers> <Wrapper Name="SessionWrapper"> <MachineName>MachineName</MachineName> <Storage> ... </Storage> </Wrapper> </Wrappers><MachineName>element is 100 characters and the value needs to be unique for each Web application in the load balanced environment. - Configure the same database in the
cd_storage_conf.xmlfor all Web applications or microservices in the load-balanced environment.
- In the
- Save and close
cd_storage_conf.xml.