public static void closeSession(Session session) {
if (session != null) {
try {
session.close();
} catch (Exception e) {
<BUG>log.error("Failed to close session: " + e.getMessage(), e);
</BUG>
}
} else {
<BUG>log.warn("Session is null, cannot close");
</BUG>
}

public static void closeSession(Session session) {
if (session != null) {
try {
session.close();
} catch (Exception e) {
LOG.error("Failed to close session: ", e);
}
} else {
LOG.warn("Session is null, cannot close");
