You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ga...@apache.org on 2016/08/31 16:29:09 UTC

[1/2] incubator-ranger git commit: RANGER-1160:Ranger installation is failing on MSSQL Server

Repository: incubator-ranger
Updated Branches:
  refs/heads/master 1a2f3f33c -> 0bc79e9fb
  refs/heads/ranger-0.6 d4cbf4f68 -> 00e07f22b


RANGER-1160:Ranger installation is failing on MSSQL Server

Signed-off-by: Gautam Borad <ga...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/00e07f22
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/00e07f22
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/00e07f22

Branch: refs/heads/ranger-0.6
Commit: 00e07f22b592d0d08f706fad0239fd860e8562a7
Parents: d4cbf4f
Author: pradeep agrawal <pr...@freestoneinfotech.com>
Authored: Thu Aug 25 09:33:10 2016 +0530
Committer: Gautam Borad <ga...@apache.org>
Committed: Wed Aug 31 21:58:51 2016 +0530

----------------------------------------------------------------------
 .../src/main/java/org/apache/ranger/common/db/BaseDao.java  | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/00e07f22/security-admin/src/main/java/org/apache/ranger/common/db/BaseDao.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/common/db/BaseDao.java b/security-admin/src/main/java/org/apache/ranger/common/db/BaseDao.java
index f64cc2d..f6b2a14 100644
--- a/security-admin/src/main/java/org/apache/ranger/common/db/BaseDao.java
+++ b/security-admin/src/main/java/org/apache/ranger/common/db/BaseDao.java
@@ -228,17 +228,10 @@ public abstract class BaseDao<T> {
 
 		String tableName = table.name();
 
-		Connection conn = entityMgr.unwrap(Connection.class);
 		try {
-			conn.createStatement().execute("SET IDENTITY_INSERT " + tableName + " " + identityInsertStr);
+			entityMgr.unwrap(Connection.class).createStatement().execute("SET IDENTITY_INSERT " + tableName + " " + identityInsertStr);
 		} catch (SQLException e) {
 			logger.error("Error while settion identity_insert " + identityInsertStr, e);
-		} finally {
-			try {
-				conn.close();
-			} catch ( SQLException sqe ) {
-				logger.error("Error while settion identity_insert " + identityInsertStr, sqe);
-			}
 		}
 	}
 


[2/2] incubator-ranger git commit: RANGER-1160:Ranger installation is failing on MSSQL Server

Posted by ga...@apache.org.
RANGER-1160:Ranger installation is failing on MSSQL Server

Signed-off-by: Gautam Borad <ga...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/0bc79e9f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/0bc79e9f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/0bc79e9f

Branch: refs/heads/master
Commit: 0bc79e9fb794feb0f7460284c6c355d08dc9de6a
Parents: 1a2f3f3
Author: pradeep agrawal <pr...@freestoneinfotech.com>
Authored: Thu Aug 25 09:33:10 2016 +0530
Committer: Gautam Borad <ga...@apache.org>
Committed: Wed Aug 31 21:58:57 2016 +0530

----------------------------------------------------------------------
 .../src/main/java/org/apache/ranger/common/db/BaseDao.java  | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/0bc79e9f/security-admin/src/main/java/org/apache/ranger/common/db/BaseDao.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/common/db/BaseDao.java b/security-admin/src/main/java/org/apache/ranger/common/db/BaseDao.java
index f64cc2d..f6b2a14 100644
--- a/security-admin/src/main/java/org/apache/ranger/common/db/BaseDao.java
+++ b/security-admin/src/main/java/org/apache/ranger/common/db/BaseDao.java
@@ -228,17 +228,10 @@ public abstract class BaseDao<T> {
 
 		String tableName = table.name();
 
-		Connection conn = entityMgr.unwrap(Connection.class);
 		try {
-			conn.createStatement().execute("SET IDENTITY_INSERT " + tableName + " " + identityInsertStr);
+			entityMgr.unwrap(Connection.class).createStatement().execute("SET IDENTITY_INSERT " + tableName + " " + identityInsertStr);
 		} catch (SQLException e) {
 			logger.error("Error while settion identity_insert " + identityInsertStr, e);
-		} finally {
-			try {
-				conn.close();
-			} catch ( SQLException sqe ) {
-				logger.error("Error while settion identity_insert " + identityInsertStr, sqe);
-			}
 		}
 	}