Bug 57147 - Fixes to Documentation of JDBC-Based Store
Fixes to Documentation of JDBC-Based Store
Status: RESOLVED FIXED
Product: Tomcat 8
Classification: Unclassified
Component: Documentation
8.0.12
PC All
: P2 normal (vote)
: ----
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2014-10-26 21:27 UTC by Fernando Ribeiro
Modified: 2014-10-29 23:20 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fernando Ribeiro 2014-10-26 21:27:44 UTC
There are some fixes to make in the documentation of the JDBC-based store [1]:

1- The connectionName and connectionPassword parameters are missing

2- The sessionAppCol, sessionDataCol, sessionIdCol, sessionLastAccessedCol, sessionMaxInactiveCol, sessionTable and sessionValidCol parameters, which are optional, seem to be marked as required

3- The DDL for the sessions table doesn't match the defaults in the JDBCStore class [2]:

CREATE TABLE tomcat$sessions (
  id VARCHAR(100) NOT NULL PRIMARY KEY,
  app VARCHAR(255),
  data MEDIUMBLOB,
  lastaccess BIGINT NOT NULL,
  maxinactive INT NOT NULL,
  valid CHAR(1) NOT NULL
);

[1] http://tomcat.apache.org/tomcat-8.0-doc/config/manager.html
[2] http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/JDBCStore.java
Comment 1 Konstantin Kolinko 2014-10-26 23:15:31 UTC
(In reply to Fernando Ribeiro from comment #0)
> 3- The DDL for the sessions table doesn't match the defaults in the
> JDBCStore class [2]:
> 
> CREATE TABLE tomcat$sessions (
>   id VARCHAR(100) NOT NULL PRIMARY KEY,
>   app VARCHAR(255),
>   data MEDIUMBLOB,
>   lastaccess BIGINT NOT NULL,
>   maxinactive INT NOT NULL,
>   valid CHAR(1) NOT NULL
> );

I see no such DDL code as above in JDBCStore class. Where is it from?
Did you take the default column names and wrote it by yourself?

I would say that the DDL in documentation has more readable column names. It also specifies "KEY kapp_name(app_name)".  Is any substantial missing in documented DDL?

I wonder whether "MEDIUMBLOB" is specific to MySQL or is actually defined in some specification.

> 1- The connectionName and connectionPassword parameters are missing

Those have to be documented.
Though a better recommendation is to use a DataSource, referenced via dataSourceName property.

When a DataSource is used, the "connectionURL", "driverName" properties are no more required.
Comment 2 Fernando Ribeiro 2014-10-27 01:14:45 UTC
(In reply to Konstantin Kolinko from comment #1)
> (In reply to Fernando Ribeiro from comment #0)
> > 3- The DDL for the sessions table doesn't match the defaults in the
> > JDBCStore class [2]:
> > 
> > CREATE TABLE tomcat$sessions (
> >   id VARCHAR(100) NOT NULL PRIMARY KEY,
> >   app VARCHAR(255),
> >   data MEDIUMBLOB,
> >   lastaccess BIGINT NOT NULL,
> >   maxinactive INT NOT NULL,
> >   valid CHAR(1) NOT NULL
> > );
> 
> I see no such DDL code as above in JDBCStore class. Where is it from?
> Did you take the default column names and wrote it by yourself?

Right.

> I would say that the DDL in documentation has more readable column names. It
> also specifies "KEY kapp_name(app_name)".  Is any substantial missing in
> documented DDL?

They may be more readable but they are not the defaults. The key may really need to be added to my DDL.

> I wonder whether "MEDIUMBLOB" is specific to MySQL or is actually defined in
> some specification.

It is a MySQL data type not available in many other databases.

> > 1- The connectionName and connectionPassword parameters are missing
> 
> Those have to be documented.
> Though a better recommendation is to use a DataSource, referenced via
> dataSourceName property.
> 
> When a DataSource is used, the "connectionURL", "driverName" properties are
> no more required.
Comment 3 Mark Thomas 2014-10-29 23:20:35 UTC
Fixed in 8.0.x for 8.0.15 onwards.