RANGER-1160:Ranger installation is failing on MSSQL Server

Signed-off-by: Gautam Borad <[email protected]>


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 <[email protected]>
Authored: Thu Aug 25 09:33:10 2016 +0530
Committer: Gautam Borad <[email protected]>
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);
-                       }
                }
        }
 

Reply via email to