You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Bip Thelin <bi...@razorfish.com> on 2001/04/20 21:01:39 UTC

Store Proposal

We've had some issues with the background threads, expiration and stuff so I
migrated some of the common stuff into a StoreBase and had JDBCStore and FileStore
extend it and have the opportunity to implement it's own processexpires and some
other methods. The code is attatched. I've also implemented an extended table for
JDBCStore, there still remains some work on using the extended fields when checking
expiration and loading I'll have that done soon. This is what a table for JDBCStore
now should look like:
TABLE [tomcat$sessions] (
	[id] [varchar] (100) NOT NULL ,
	[data] [varbinary] (1000) NULL ,
	[valid] [char] (1) NOT NULL ,
	[maxinactive] [int] NOT NULL ,
	[lastaccess] [numeric](18, 0) NULL 
)

Here's how you can configure the table and column names:

<!--Store className="org.apache.catalina.session.JDBCStore" driverName="SQLDriver" connectionURL="jdbc:protocol://server?user=;password="
sessionTable="tomcat$sessions" sessionIdCol="id" sessionDataCol="data" sessionValidCol="valid" sessionMaxInactiveCol="maxinactive"
sessionLastAccessedCol="lastaccess" debug="99"/-->


	..bip

Re: Store Proposal

Posted by Kief Morris <ki...@bitbull.com>.
Bip Thelin typed the following on 06:26 PM 4/21/2001 -0700
>Kief Morris wrote:
>> 
>> [...]
>> 
>> Great - can you provide these patches as file attachments? They came in the
>> body of your message, which is very difficult to reliably apply to the 
>sources.
>
>Attached is the files, the CustomObjectInputstream goes in the util dir.

This looks pretty reasonable. I haven't committed these because I've discovered
a bug in the PersistentManager/Store code (regardless of your changes), which
shows up when I enable PersistentManager in the tester. It looks like the session 
isn't going away properly when it's invalidated:

HttpSession:
...
FAIL [GET /tester/Session04] Expected data 'Session04 PASSED', got data 'Session04 FAILED -KSM New session id = old session id/ New session has attribute already/'
...
FAIL [GET /tester/WrappedSession04] Expected data 'Session04 PASSED', got data 'Session04 FAILED -KSM New session id = old session id/ New session has attribute already/'

Here's what I put in server.xml to run tester:

        <Context path="/examples" docBase="examples" debug="0"
                 reloadable="true">
          <Manager className="org.apache.catalina.session.PersistentManager"
              debug="3"
              saveOnRestart="true"
              maxActiveSessions="-1"
              minIdleSwap="-1"
              maxIdleSwap="-1"
              maxIdleBackup="-1">
                <Store className="org.apache.catalina.session.FileStore"
					debug="3"/>
          </Manager>
		</Context>
		
Need to think about how to fit PersistentManager into the tester app - it
requires a configuration change. We can set up a separate webapp
for persistent session testing, but it will need to duplicate pretty much
everything in the existing tester app, since we want to test the full package.
Alternately, have a separate build target. 

Either way, I think enabling PersistentManager is always going to require changing 
server.xml, but how to do this with tester as it is seems non-obvious to me, since
it doesn't modify Catalina's default server.xml.

Kief


Re: Store Proposal

Posted by Bip Thelin <bi...@razorfish.com>.
Kief Morris wrote:
> 
> [...]
> 
> Great - can you provide these patches as file attachments? They came in the
> body of your message, which is very difficult to reliably apply to the sources.

Attached is the files, the CustomObjectInputstream goes in the util dir.

	..bip

Re: Store Proposal

Posted by Kief Morris <ki...@bitbull.com>.
Bip Thelin typed the following on 12:01 PM 4/20/2001 -0700
>We've had some issues with the background threads, expiration and stuff so I
>migrated some of the common stuff into a StoreBase and had JDBCStore and 
>FileStore
>extend it and have the opportunity to implement it's own processexpires and 
>some
>other methods. The code is attatched. 

Great - can you provide these patches as file attachments? They came in the
body of your message, which is very difficult to reliably apply to the sources.

Kief