mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Fixed DAO connection close issue.
This commit is contained in:
parent
f0669887fb
commit
cb1c0c0439
@ -83,16 +83,15 @@ public class AndroidDAOFactory extends AbstractMobileDeviceManagementDAOFactory
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
throw new MobileDeviceManagementDAOException("Error occurred while committing the transaction", e);
|
||||
} finally {
|
||||
closeConnection();
|
||||
}
|
||||
}
|
||||
|
||||
public static void closeConnection() throws MobileDeviceManagementDAOException {
|
||||
|
||||
Connection con = currentConnection.get();
|
||||
Connection conn = currentConnection.get();
|
||||
try {
|
||||
con.close();
|
||||
if (conn != null) {
|
||||
conn.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
log.error("Error occurred while close the connection");
|
||||
}
|
||||
@ -112,8 +111,6 @@ public class AndroidDAOFactory extends AbstractMobileDeviceManagementDAOFactory
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
throw new MobileDeviceManagementDAOException("Error occurred while rollback the transaction", e);
|
||||
} finally {
|
||||
closeConnection();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user