Index: tomcat/src/main/org/jboss/web/tomcat/service/session/persistent/AbstractPersistentManager.java =================================================================== --- tomcat/src/main/org/jboss/web/tomcat/service/session/persistent/AbstractPersistentManager.java (revision 113685) +++ tomcat/src/main/org/jboss/web/tomcat/service/session/persistent/AbstractPersistentManager.java (revision 113686) @@ -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()); Index: tomcat/src/main/org/jboss/web/tomcat/service/session/persistent/RDBMSStoreBase.java =================================================================== --- tomcat/src/main/org/jboss/web/tomcat/service/session/persistent/RDBMSStoreBase.java (revision 113685) +++ tomcat/src/main/org/jboss/web/tomcat/service/session/persistent/RDBMSStoreBase.java (revision 113686) @@ -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. * */