This may be the answer to the wrong question, but a long time ago I discovered that when weblogic was running out of memory, it would dump random sessions. The solution was to configure the application server to persist sessions in the database. This also allowed sessions to fail over to the other instance. We carried this solution forward when we migrated to tomcat. Here's a context.xml that turns this on.

<Context antiJARLocking="true" antiResourceLocking="true" path="/"> <Manager className="org.apache.catalina.session.PersistentManager" debug="0" saveOnRestart="true" maxActiveSessions="-1" minIdleSwap="-1" maxIdleSwap="-1" maxIdleBackup="-1"> <Store className="org.apache.catalina.session.JDBCStore" driverName="oracle.jdbc.OracleDriver"
                connectionURL="${session.store.url}"
                 sessionTable="tomcat_sessions"
                 sessionIdCol="SESSION_ID"
                 sessionDataCol="session_data"
                 sessionValidCol="valid_session"
                 sessionMaxInactiveCol="max_inactive"
                 sessionLastAccessedCol="last_access"
                 sessionAppCol="app_name"
                 checkInterval="60"
                 debug="99" />
</Manager>
</Context>

${session.store.url} corresponds to a "-Dsession.store.url=xxx" in my setenv.sh file, but you could just as easily hardcode it here. I like parameterizing it so my dev/test tomcat instances can point to different stores.

Here's the schema:

create table tomcat_sessions (
   session_id     varchar2(100) not null,
   valid_session  char(1) not null,
   max_inactive   number(20) not null,
   last_access    number(20) not null,
   app_name       varchar2(255),
   session_data   blob,
   constraint pk_tomcat_sessions primary key (session_id, app_name)
);

For oracle, I dropped ojdbc14.jar in tomcat's common/lib folder. Due to a bug (which may be fixed), I had to include the username/password as part of the connection URL rather than as separate attributes.

-Steve

Marcos Chicote wrote:
Hello.
I've developed an app using tapestry4 + spring + hibernate and I can't make 
work in a clustered enviroment using 2 tomcat instances.
The problem is that the StaleSession page appears really fast.
All my objects and classes implement Serializable, but I don't know if tapestry 
is storing in session stuff that isn't Serializable.

Does anybode have any experience clustering a tapestry app??

Thanks
Marcos



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to