cancel
Showing results for 
Search instead for 
Did you mean: 

DBSqlSessionFacotry forcing commit

frederikherema1
Star Contributor
Star Contributor
Hi Team,

Anyone an idea why SqlSession.commit(boolean force) is called with argument true, in eg. DbSqlSessionFactory.dbSchemaCheckVersion, instead of the default commit()?
The commit() on DefaultSQLSession will check the autocommit-flag and won't commit when it is on. Forcing just ignores this flag, resulting in an exception.

If there is no particular reason for forcing, I'll use the default commit() instead.
1 REPLY 1

tombaeyens
Champ in-the-making
Champ in-the-making
we're talking about these code pieces in DbSqlSessionFactory

    } finally {
      if (success) {
        sqlSession.commit(true);
      } else {
        sqlSession.rollback(true);
      }
      sqlSession.close();
    }

do you know a reason why we should not change that to

    } finally {
      if (success) {
        sqlSession.commit();  // default force is false
      } else {
        sqlSession.rollback();   // default force is false
      }
      sqlSession.close();
    }

?
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.