I have a setup of 2 independent WebLogic 9.2.1 servers (they are Managed servers with their own Admin server). So no Clustering has been setup. They are configured with JDBC Session Persistence. Furthermore each of the WebLogic servers have their own Apache 2 Front-End with the WebLogic plugin only forwarding traffic to their respective WebLogic server. In front of the Apache 2 servers I have a hardware Load Balancer. Currently we are getting Constraint Violations from the Oracle database that hosts the table used for session persistence.
I found out that the hardware load balancer is using sticky IP's (so sessions should also be sticky as a result). But it escapes me what is wrong in the setup?
WebLogic log:
####<Apr 26, 2011 13:00:08.0428 CEST> <Error> <HTTP Session> <sktpens01por02> <SktEnsPorServer1> <[ACTIVE] ExecuteThread: '230' for queue: 'weblogic.kernel.Default (self-tuning)'> <skatGuid=6fa90948-b285-45a5-954b-45e22bfc26c2,ou=company,ou=external,ou=entities,dc=skat,dc=dk> <> <> <1303815608428> <BEA-100087> <The jdbc session data for session id: lZbJN2jTbPZjTf81vSrKytxDdYCpwTgblJhnck3RhTcPf3FQr1Pw ctx:front dblat:1303815595796 triggerLAT:0 has been modified by another server in the cluster. java.sql.SQLException: ORA-00001: unique constraint (FRONTSESSIONS.SYS_C0056504) violated at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:219) at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:970) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1190) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3370) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3454) at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:128) at weblogic.servlet.internal.session.JDBCSessionData.dbCreate(JDBCSessionData.java:181) at weblogic.servlet.internal.session.JDBCSessionData.dbUpdate(JDBCSessionData.java:242) at weblogic.servlet.internal.session.JDBCSessionData.syncSession(JDBCSessionData.java:583) at weblogic.servlet.internal.session.JDBCSessionContext.sync(JDBCSessionContext.java:232) at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSession(ServletRequestImpl.java:2507) at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSession(ServletRequestImpl.java:2482) at weblogic.servlet.internal.ServletResponseImpl$1.run(ServletResponseImpl.java:1308) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.ServletResponseImpl.send(ServletResponseImpl.java:1302) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1368) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:181) > ####<Apr 26, 2011 13:00:08.0436 CEST> <Error> <HTTP Session> <sktpens01por02> <SktEnsPorServer1> <[ACTIVE] ExecuteThread: '230' for queue: 'weblogic.kernel.Default (self-tuning)'> <skatGuid=6fa90948-b285-45a5-954b-45e22bfc26c2,ou=company,ou=external,ou=entities,dc=skat,dc=dk> <> <> <1303815608436> <BEA-100060> <An unexpected error occurred while retrieving the session for Web application: weblogic.servlet.internal.WebAppServletContext@26f86bfb - appName: 'Portal-Front', name: 'front', context-path: '/front'. java.sql.SQLException: ORA-00001: unique constraint (FRONTSESSIONS.SYS_C0056504) violated at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:219) at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:970) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1190) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3370) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3454) at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:128) at weblogic.servlet.internal.session.JDBCSessionData.dbCreate(JDBCSessionData.java:181) at weblogic.servlet.internal.session.JDBCSessionData.dbUpdate(JDBCSessionData.java:242) at weblogic.servlet.internal.session.JDBCSessionData.syncSession(JDBCSessionData.java:583) at weblogic.servlet.internal.session.JDBCSessionContext.sync(JDBCSessionContext.java:232) at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSession(ServletRequestImpl.java:2507) at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.syncSession(ServletRequestImpl.java:2482) at weblogic.servlet.internal.ServletResponseImpl$1.run(ServletResponseImpl.java:1308) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.ServletResponseImpl.send(ServletResponseImpl.java:1302) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1368) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:181) >
Oracle Table definition:
CREATE TABLE "FRONTSESSIONS"."WL_SERVLET_SESSIONS"
(
"WL_ID" VARCHAR2(100 BYTE) NOT NULL ENABLE,
"WL_CONTEXT_PATH" VARCHAR2(100 BYTE) NOT NULL ENABLE,
"WL_IS_NEW" CHAR(1 BYTE),
"WL_CREATE_TIME" NUMBER(20,0),
"WL_IS_VALID" CHAR(1 BYTE),
"WL_SESSION_VALUES" LONG RAW,
"WL_ACCESS_TIME" NUMBER(20,0),
"WL_MAX_INACTIVE_INTERVAL" NUMBER(*,0),
PRIMARY KEY ("WL_ID", "WL_CONTEXT_PATH") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "FRONTSESSIONS" ENABLE
)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
(
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
)
TABLESPACE "FRONTSESSIONS" ;
Thanks!
The fact that those are 2 independent servers (without clustering in WebLogic sense) does not stop WebLogic to generate same ids for sessions. If those 2 servers where in a cluster, then WebLogic would add node id as part of the session id. But becuase servers are not in the cluster, of course, there is a chance that at some point they will generate same session id.
The only way you can avoid that exception is to configure both servers to use different tables or database for session storage.