Fixed DAO connection close issue.

revert-dabc3590
harshanl 9 years ago
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…
Cancel
Save