[jboss-cvs] JBossAS SVN: r114615 - branches/JBPAPP_5/tomcat/src/main/org/jboss/web/tomcat/service/session/persistent.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Dec 19 13:15:56 EST 2013
Author: dereed
Date: 2013-12-19 13:15:56 -0500 (Thu, 19 Dec 2013)
New Revision: 114615
Modified:
branches/JBPAPP_5/tomcat/src/main/org/jboss/web/tomcat/service/session/persistent/AbstractPersistentManager.java
branches/JBPAPP_5/tomcat/src/main/org/jboss/web/tomcat/service/session/persistent/RDBMSStoreBase.java
Log:
[JBPAPP-10206] Workaround for session persistence to an Oracle DB for the root context
Modified: branches/JBPAPP_5/tomcat/src/main/org/jboss/web/tomcat/service/session/persistent/AbstractPersistentManager.java
===================================================================
--- branches/JBPAPP_5/tomcat/src/main/org/jboss/web/tomcat/service/session/persistent/AbstractPersistentManager.java 2013-12-19 15:22:15 UTC (rev 114614)
+++ branches/JBPAPP_5/tomcat/src/main/org/jboss/web/tomcat/service/session/persistent/AbstractPersistentManager.java 2013-12-19 18:15:56 UTC (rev 114615)
@@ -43,6 +43,11 @@
private final P store;
/**
+ * Substitute app name for root context with "/" to work around Oracle DB bug (JBPAPP-10206)
+ */
+ private Boolean substituteRootContext = null;
+
+ /**
* The connection username to use when trying to connect to the database.
*/
private String connectionName = null;
@@ -152,6 +157,19 @@
}
+
+ public Boolean getSubstituteRootContext()
+ {
+ return substituteRootContext;
+ }
+
+
+ public void setSubstituteRootContext(Boolean substituteRootContext)
+ {
+ this.substituteRootContext = substituteRootContext;
+ }
+
+
public String getConnectionName()
{
return connectionName;
@@ -400,6 +418,10 @@
store.setName(this.getContextName());
store.setMaxUnreplicatedInterval(getMaxUnreplicatedInterval());
+ if (getSubstituteRootContext() != null)
+ {
+ store.setSubstituteRootContext(getSubstituteRootContext().booleanValue());
+ }
if (getConnectionName() != null)
{
store.setConnectionName(getConnectionName());
Modified: branches/JBPAPP_5/tomcat/src/main/org/jboss/web/tomcat/service/session/persistent/RDBMSStoreBase.java
===================================================================
--- branches/JBPAPP_5/tomcat/src/main/org/jboss/web/tomcat/service/session/persistent/RDBMSStoreBase.java 2013-12-19 15:22:15 UTC (rev 114614)
+++ branches/JBPAPP_5/tomcat/src/main/org/jboss/web/tomcat/service/session/persistent/RDBMSStoreBase.java 2013-12-19 18:15:56 UTC (rev 114615)
@@ -76,6 +76,11 @@
* Context name associated with this Store
*/
private String name = null;
+
+ /**
+ * Substitute app name for root context with "/" to work around Oracle DB bug (JBPAPP-10206)
+ */
+ private boolean substituteRootContext = false;
/**
* How often to execute the processExpires cleanup
@@ -232,6 +237,10 @@
{
throw new IllegalStateException("Must configure a name for PersistentStore");
}
+ if (substituteRootContext && "".equals(name))
+ {
+ return "/"; // work around Oracle bug with empty strings
+ }
return name;
}
@@ -241,6 +250,25 @@
}
/**
+ * Return whether to use "/" as the app name in the DB for applications in the root context
+ *
+ */
+ public boolean getSubstituteRootContext()
+ {
+ return (this.substituteRootContext);
+ }
+
+ /**
+ * Set whether to use "/" as the app name in the DB for applications in the root context
+ *
+ * @param substituteRootContext whether to do the substitution
+ */
+ public void setSubstituteRootContext(boolean substituteRootContext)
+ {
+ this.substituteRootContext = substituteRootContext;
+ }
+
+ /**
* Return the username to use to connect to the database.
*
*/
More information about the jboss-cvs-commits
mailing list