My question is simple. Is it possible to reuse a session after a transaction like this?
try (SqlSession session = sqlSessionFactory.openSession()) {
// following 3 lines pseudocode for "doing some work"
session.insert(...);
session.update(...);
session.delete(...);
session.commit();
session.insert();
session.commit();
}
Or is it better to close the session after committing and open a new session?
source
share