/** * Creates new database session with default transaction mode and in autocommit mode. */ public DbSession(ConnectionProvider connectionProvider) { log.debug("Creating new db session"); if (connectionProvider == null) { connectionProvider = DbOom.get().connectionProvider(); if (connectionProvider == null) { throw new DbSqlException("Connection provider is not available"); } } this.connectionProvider = connectionProvider; this.txActive = false; this.txMode = DbTransactionMode.READ_ONLY_TX; this.queries = new HashSet<>(); }
/** * Creates new database session with default transaction mode and in autocommit mode. */ public DbSession(ConnectionProvider connectionProvider) { log.debug("Creating new db session"); if (connectionProvider == null) { connectionProvider = DbOom.get().connectionProvider(); if (connectionProvider == null) { throw new DbSqlException("Connection provider is not available"); } } this.connectionProvider = connectionProvider; this.txActive = false; this.txMode = DbTransactionMode.READ_ONLY_TX; this.queries = new HashSet<>(); }