Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6A777E95B for ; Thu, 7 Feb 2013 07:44:09 +0000 (UTC) Received: (qmail 96184 invoked by uid 500); 7 Feb 2013 07:44:06 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 95953 invoked by uid 500); 7 Feb 2013 07:44:04 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 94279 invoked by uid 99); 7 Feb 2013 07:43:58 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Feb 2013 07:43:58 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id F1F14249F1; Thu, 7 Feb 2013 07:43:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: muralireddy@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [37/50] [abbrv] Sync master to javelin one more time Message-Id: <20130207074357.F1F14249F1@tyr.zones.apache.org> Date: Thu, 7 Feb 2013 07:43:57 +0000 (UTC) http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7b75f0d9/server/test/resources/VpcApiUnitTestContext.xml ---------------------------------------------------------------------- diff --cc server/test/resources/VpcApiUnitTestContext.xml index 0000000,0000000..d933022 new file mode 100644 --- /dev/null +++ b/server/test/resources/VpcApiUnitTestContext.xml @@@ -1,0 -1,0 +1,42 @@@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7b75f0d9/setup/db/create-schema.sql ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7b75f0d9/utils/conf/db.properties ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7b75f0d9/utils/src/com/cloud/utils/db/GenericDaoBase.java ---------------------------------------------------------------------- diff --cc utils/src/com/cloud/utils/db/GenericDaoBase.java index 623c349,4ecf242..cf30474 --- a/utils/src/com/cloud/utils/db/GenericDaoBase.java +++ b/utils/src/com/cloud/utils/db/GenericDaoBase.java @@@ -1799,7 -1802,12 +1799,12 @@@ public abstract class GenericDaoBase sc) { String clause = sc != null ? sc.getWhereClause() : null; if (clause != null && clause.length() == 0) { http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7b75f0d9/utils/src/com/cloud/utils/db/Transaction.java ---------------------------------------------------------------------- diff --cc utils/src/com/cloud/utils/db/Transaction.java index 6884fb1,13125f8..73f5bb1 --- a/utils/src/com/cloud/utils/db/Transaction.java +++ b/utils/src/com/cloud/utils/db/Transaction.java @@@ -1066,21 -1050,22 +1067,27 @@@ public class Transaction System.setProperty("javax.net.ssl.trustStorePassword", dbProps.getProperty("db.cloud.trustStorePassword")); } + String regionId = dbProps.getProperty("region.id"); + if(regionId == null){ + s_region_id = 1; + } else { + s_region_id = Integer.parseInt(regionId); + } final GenericObjectPool cloudConnectionPool = new GenericObjectPool(null, cloudMaxActive, GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION, cloudMaxWait, cloudMaxIdle, cloudTestOnBorrow, false, cloudTimeBtwEvictionRunsMillis, 1, cloudMinEvcitableIdleTimeMillis, cloudTestWhileIdle); - final ConnectionFactory cloudConnectionFactory = new DriverManagerConnectionFactory("jdbc:mysql://"+cloudHost + ":" + cloudPort + "/" + cloudDbName + - "?autoReconnect="+cloudAutoReconnect + (url != null ? "&" + url : "")+ (useSSL ? "&useSSL=true" : ""), cloudUsername, cloudPassword); + + final ConnectionFactory cloudConnectionFactory = new DriverManagerConnectionFactory("jdbc:mysql://" + cloudHost + ":" + cloudPort + "/" + cloudDbName + + "?autoReconnect=" + cloudAutoReconnect + (url != null ? "&" + url : "") + (useSSL ? "&useSSL=true" : ""), cloudUsername, cloudPassword); + final KeyedObjectPoolFactory poolableObjFactory = (cloudPoolPreparedStatements ? new StackKeyedObjectPoolFactory() : null); + final PoolableConnectionFactory cloudPoolableConnectionFactory = new PoolableConnectionFactory(cloudConnectionFactory, cloudConnectionPool, poolableObjFactory, cloudValidationQuery, false, false, isolationLevel); + + // Default Data Source for CloudStack s_ds = new PoolingDataSource(cloudPoolableConnectionFactory.getPool()); - // configure the usage db + // Configure the usage db final int usageMaxActive = Integer.parseInt(dbProps.getProperty("db.usage.maxActive")); final int usageMaxIdle = Integer.parseInt(dbProps.getProperty("db.usage.maxIdle")); final long usageMaxWait = Long.parseLong(dbProps.getProperty("db.usage.maxWait"));