Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 541A8174AC for ; Fri, 13 Feb 2015 13:50:28 +0000 (UTC) Received: (qmail 59620 invoked by uid 500); 13 Feb 2015 13:50:12 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 59519 invoked by uid 500); 13 Feb 2015 13:50:12 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 59508 invoked by uid 99); 13 Feb 2015 13:50:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Feb 2015 13:50:12 +0000 Date: Fri, 13 Feb 2015 13:50:12 +0000 (UTC) From: "denixx baykin (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DBCP-435) [PATCH] Friendly BasicDataSourceFactory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DBCP-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14320082#comment-14320082 ] denixx baykin commented on DBCP-435: ------------------------------------ My vision of problem says this way you can help all your users to better understand, that all will be ok with those Resource's, which they use. > [PATCH] Friendly BasicDataSourceFactory > --------------------------------------- > > Key: DBCP-435 > URL: https://issues.apache.org/jira/browse/DBCP-435 > Project: Commons Dbcp > Issue Type: Improvement > Affects Versions: Nightly Builds > Environment: commons-dbcp2, Tomcat 8 > Reporter: denixx baykin > Priority: Critical > Labels: friendly, patch > Fix For: Nightly Builds > > Attachments: commons-dbcp2-friendly-BasicDataSourceFactory.patch > > > I wish to make DBCP2 main component (BasicDataSourceFactory) more friendly. > This is a component which end user faces in Tomcat, when he tries to configure DataSource in Tomcat. > I think factory should help user (in our case it is administrators) to understand, that he make a mistake in configuration. > Tested with Tomcat 8 from trunk. > Properly configured Resource in context.xml or server.xml will leave nothing in logs: > {code:xml} type="javax.sql.DataSource" > validationQuery="SELECT 1" > timeBetweenEvictionRunsMillis="30000" > maxTotal="20" > maxIdle="10" > minIdle="1" > maxWaitMillis="2000" > initialSize="20" > removeAbandonedTimeout="60" > removeAbandonedOnMaintenance="true" > logAbandoned="true" > minEvictableIdleTimeMillis="30000" > username="admin" > password="megapassword" > driverClassName="com.mysql.jdbc.Driver" > url="jdbc:mysql://localhost:3306/new_schema"/>{code} > But filling something wrong will output warnings to logfiles (stderr and logger): > {code:xml} auth="Container" > factory="org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory" > type="javax.sql.DataSource" > validationQuery="SELECT 1" > validationInterval="30000" > timeBetweenEvictionRunsMillis="30000" > maxActive="20" > maxIdle="10" > minIdle="1" > maxWait="20000" > initialSize="20" > removeAbandonedTimeout="60" > removeAbandoned="true" > logAbandoned="true" > minEvictableIdleTimeMillis="30000" > jmxEnabled="true" > jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer" > username="admin" > password="megapassword" > driverClassName="com.mysql.jdbc.Driver" > url="jdbc:mysql://localhost:3306/new_schema"/>{code} > logfile output: > {noformat}13-Feb-2015 15:30:44.178 WARNING [main] org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory.getObjectInstance WARNING! Property maxActive is not used since DBCP2, use maxTotal instead. maxTotal default value is 8. You have set value of "20" for "maxActive" property > WARNING! Property removeAbandoned is not used since DBCP2, use one or both of removeAbandonedOnBorrow or removeAbandonedOnMaintenance instead. Both have default value set to false. You have set value of "true" for "removeAbandoned" property > WARNING! Property maxWait is not used in DBCP (it's a Tomcat JDBC pool feature), use maxWaitMillis instead. maxWaitMillis default value is -1. You have set value of "20000" for "maxWait" property > WARNING! Property validationInterval is not used in DBCP, it's a Tomcat JDBC pool feature. Ignoring. You have set value of "30000" for "validationInterval" property > WARNING! Property jdbcInterceptors is not used in DBCP, it's a Tomcat JDBC pool feature. Ignoring. You have set value of "org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer" for "jdbcInterceptors" property > WARNING! Property jmxEnabled is not used in DBCP, it's a Tomcat JDBC pool feature. Ignoring. You have set value of "true" for "jmxEnabled" property > INFO. Ignoring unknown property: value of "Container" for "auth" property > INFO. Ignoring unknown property: value of "org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory" for "factory" property{noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)