J
js
Hi,
I am using SunOne WebServer 6.1. I would like to use JDBC as the persistent
mechanism for storing sessions, and this is possible with SunOne 6.1 via
the JdbcStore:
http://docs.sun.com/source/817-1833-10/pwasessn.html
I have tried it and it works, using the following as an example on ASE
12.5.x on Solaris SPARC with JConnect 5.x JDBC:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Sun ONE Web
Server 6.1 Servlet 2.3//EN'
'http://www.sun.com/software/sunone/appserver/dtds/sun-web-app_2_3-1.dtd'>
<sun-web-app>
<session-config>
<session-manager persistence-type="s1ws60">
<manager-properties>
<property name="classname"
value="com.iplanet.server.http.session.IWSSessionManager"/>
<property name="session-data-store"
value="com.iplanet.server.http.session.JdbcStore"/>
<property name="session-failover-enabled" value="true"/>
<property name="provider" value="com.sybase.jdbc2.jdbc.SybDriver"/>
<property name="url"
value="jdbc:sybase:Tds:192.168.0.80:4100?BE_AS_JDBC_COMPLIANT_AS_POSSIBLE=true&DYNAMIC_PREPARE=true&SELECT_OPENS_CURSOR=false&JCONNECT_VERSION=6&PACKETSIZE=4096"/>
<property name="username" value="xxxxx"/>
<property name="password" value="yyyyy"/>
</manager-properties>
<store-properties>
</store-properties>
</session-manager>
</session-config>
</sun-web-app>
Now my problem is, when I initially created the session table:
create table sessions
(
SessionID varchar(100),
AccessTime numeric(9),
TimeOut numeric(9),
Value varbinary(4096)
)
go
create unique index sessions_udx on sessions( SessionID )
go
.... I get:
Warning: Row size (4230 bytes) could exceed row size limit, which is 4010
bytes.
Fair enough, my database pagesize is 4K, so I dropped the table and changed
Value so that it is varbinary(3876) ... this time, no warning.
Now what I am worried is ... [ even if I have varbinary(4096) ], is the size
large enough ?
I can't find any limit anywhere on spec on what should be the max size for
an HttpSession .. .so maybe there isn't one.
I am tempted to extend the JdbcStore class so that session data is stored on
a SQL BLOB, which will address the size issue, at the cost of some I/O
performance, which I can fine tune ( I am also the DBA ) ... but it will
never be as fast as varbinary because of the extra I/O accessing blobs
( called images in Sybase ASE ) on separate data pages from the actual row.
In that event, what have you guys done using JDBC for storing HttpSessions ?
What about other commercial implementations that use JDBC for storing
HttpSessions ? What do they do ?
I am using SunOne WebServer 6.1. I would like to use JDBC as the persistent
mechanism for storing sessions, and this is possible with SunOne 6.1 via
the JdbcStore:
http://docs.sun.com/source/817-1833-10/pwasessn.html
I have tried it and it works, using the following as an example on ASE
12.5.x on Solaris SPARC with JConnect 5.x JDBC:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Sun ONE Web
Server 6.1 Servlet 2.3//EN'
'http://www.sun.com/software/sunone/appserver/dtds/sun-web-app_2_3-1.dtd'>
<sun-web-app>
<session-config>
<session-manager persistence-type="s1ws60">
<manager-properties>
<property name="classname"
value="com.iplanet.server.http.session.IWSSessionManager"/>
<property name="session-data-store"
value="com.iplanet.server.http.session.JdbcStore"/>
<property name="session-failover-enabled" value="true"/>
<property name="provider" value="com.sybase.jdbc2.jdbc.SybDriver"/>
<property name="url"
value="jdbc:sybase:Tds:192.168.0.80:4100?BE_AS_JDBC_COMPLIANT_AS_POSSIBLE=true&DYNAMIC_PREPARE=true&SELECT_OPENS_CURSOR=false&JCONNECT_VERSION=6&PACKETSIZE=4096"/>
<property name="username" value="xxxxx"/>
<property name="password" value="yyyyy"/>
</manager-properties>
<store-properties>
</store-properties>
</session-manager>
</session-config>
</sun-web-app>
Now my problem is, when I initially created the session table:
create table sessions
(
SessionID varchar(100),
AccessTime numeric(9),
TimeOut numeric(9),
Value varbinary(4096)
)
go
create unique index sessions_udx on sessions( SessionID )
go
.... I get:
Warning: Row size (4230 bytes) could exceed row size limit, which is 4010
bytes.
Fair enough, my database pagesize is 4K, so I dropped the table and changed
Value so that it is varbinary(3876) ... this time, no warning.
Now what I am worried is ... [ even if I have varbinary(4096) ], is the size
large enough ?
I can't find any limit anywhere on spec on what should be the max size for
an HttpSession .. .so maybe there isn't one.
I am tempted to extend the JdbcStore class so that session data is stored on
a SQL BLOB, which will address the size issue, at the cost of some I/O
performance, which I can fine tune ( I am also the DBA ) ... but it will
never be as fast as varbinary because of the extra I/O accessing blobs
( called images in Sybase ASE ) on separate data pages from the actual row.
In that event, what have you guys done using JDBC for storing HttpSessions ?
What about other commercial implementations that use JDBC for storing
HttpSessions ? What do they do ?