Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7C2712009E2 for ; Wed, 1 Jun 2016 17:39:44 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7AB88160A4D; Wed, 1 Jun 2016 15:39:44 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C0941160A4C for ; Wed, 1 Jun 2016 17:39:43 +0200 (CEST) Received: (qmail 41292 invoked by uid 500); 1 Jun 2016 15:39:37 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 41279 invoked by uid 99); 1 Jun 2016 15:39:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Jun 2016 15:39:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AE9EEE08E8; Wed, 1 Jun 2016 15:39:37 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: swill@apache.org To: commits@cloudstack.apache.org Date: Wed, 01 Jun 2016 15:39:38 -0000 Message-Id: In-Reply-To: <7f5002f1206d4bd0b6af34b0ba30c43a@git.apache.org> References: <7f5002f1206d4bd0b6af34b0ba30c43a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] git commit: updated refs/heads/master to 971c8a7 archived-at: Wed, 01 Jun 2016 15:39:44 -0000 Merge pull request #1574 from nlivens/mysql_driver_issue Make sure that the DB drivers are loaded before creating connectionsI've digged deeper, and found out that Tomcat is really specific in how it loads the JDBC drivers apparently. If we would be using the standard JDBC connection pooling of Tomcat (tomcat-jdbc) instead of commons-dbcp, we would have the option to specify a "driverClassName" when creating our connection. This is not the case for commons-dbcp, which we are using within ACS. If you check an official example of Tomcat : https://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html#Plain_Ol'_Java or https://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html#As_a_Resource As you can see in the above examples, both of them specify the driverClassName. In the underlying implementation of Tomcat, Tomcat will do ```Class.forName(driverClassName)``` which will trigger the auto-registration of the Driver. Tomcat code : ```java if (driver==null) { if (log.isDebugEnabled()) { log.debug("Instantiating driver using class: "+poolProperties.getDriverClassName()+" [url="+poolProperties.getUrl()+"]"); } driver = (java.sql.Driver) Class.forName(poolProperties.getDriverClassName(), true, PooledConnection.class.getClassLoader() ).newInstance(); } ``` * pr/1574: Make sure that the DB drivers are loaded before initiating connections Signed-off-by: Will Stevens Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/971c8a74 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/971c8a74 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/971c8a74 Branch: refs/heads/master Commit: 971c8a74e487e1048dd85338b80baa15902858d4 Parents: bb9148b c956749 Author: Will Stevens Authored: Wed Jun 1 11:39:15 2016 -0400 Committer: Will Stevens Committed: Wed Jun 1 11:39:16 2016 -0400 ---------------------------------------------------------------------- .../db/src/com/cloud/utils/db/DriverLoader.java | 69 ++++++++++++++++++++ .../com/cloud/utils/db/TransactionLegacy.java | 18 +---- 2 files changed, 72 insertions(+), 15 deletions(-) ----------------------------------------------------------------------