https://bz.apache.org/bugzilla/show_bug.cgi?id=58338

            Bug ID: 58338
           Summary: BasicDataSourceFactory uses wrong attribute name
           Product: Tomcat 7
           Version: 7.0.64
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: h...@fixion.nl

According to the Tomcat 7 "JNDI Resources HOW-TO" part "JDBC resources"
documentation one or more initial SQL statement(s) for each created connection
can be specified using "connectionInitSqls" attribute on the Resource element.

Looking at class BasicDataSource this property is indeed there (field
"connectionInitSqls")

However, the class BasicDataSourceFactory, the JNDI factory used by Tomcat to
create a BasicDataSource instance, uses another attribute-name for this
property:

...
private final static String PROP_INITCONNECTIONSQLS = "initConnectionSqls";
...

...
value = properties.getProperty(PROP_INITCONNECTIONSQLS);
if (value != null) {
  StringTokenizer tokenizer = new StringTokenizer(value, ";");
  dataSource.setConnectionInitSqls(Collections.list(tokenizer));
}
...

My suggestion is to keep the documentation as is and update the class
BasicDataSourceFactory. For example like this (of course field name may also be
updated too, to reflect the property name) :

...
private final static String PROP_INITCONNECTIONSQLS = "connectionInitSqls";
...

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to