mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Check null before close connection
This commit is contained in:
parent
3dcb42ee64
commit
f68c7133cf
@ -94,12 +94,14 @@ public class OperationManagementDAOFactory {
|
||||
public static void closeConnection() throws OperationManagementDAOException {
|
||||
|
||||
Connection con = currentConnection.get();
|
||||
try {
|
||||
con.close();
|
||||
} catch (SQLException e) {
|
||||
log.error("Error occurred while close the connection");
|
||||
if (con != null) {
|
||||
try {
|
||||
con.close();
|
||||
} catch (SQLException e) {
|
||||
log.error("Error occurred while close the connection");
|
||||
}
|
||||
currentConnection.remove();
|
||||
}
|
||||
currentConnection.remove();
|
||||
}
|
||||
|
||||
public static void commitTransaction() throws OperationManagementDAOException {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user