The default transaction has the following parameters: , the same parameters that are used by the JDBC driver. You can change the default isolation mode using the parameters of the connection pool — see BasicDataSource.setDefaultTransactionIsolation in the getDataSource method of the JooqConfig configuration class.

    In jOOQ you have several ways to control transactions explicitly. Since we are going to develop our application using the Spring Framework, we will use the transaction manager specified in the configuration (JooqConfig). You can get the transaction manager by declaring the txMgr property in the class as follows:

    The standard scenario for using this technique with a transaction would be coded like this:

    However, Spring enables that scenario to be implemented much more easily using the @Transactional annotation specified before the method of the class. Thereby, all actions performed by the method will be wrapped in the transaction.

    Transaction Parameters

    Propagation

    The propagation parameter defines how to work with transactions if our method is called from an external transaction.

    Isolation Level

    The isolation parameter defines the isolation level. Five values are supported: DEFAULT, READ_UNCOMMITTED, READ_COMMITTED, REPEATABLE_READ, SERIALIZABLE. If the DEFAULT value of the isolation parameter is specified, that level will be used.

    The other isolation levels are taken from the SQL standard, not all of them supported exactly by Firebird. Only the READ_COMMITED level corresponds in all of the criteria, so JDBC READ_COMMITTED is mapped into read_committed in Firebird. is mapped into concurrency (SNAPSHOT) and SERIALIZABLE is mapped into consistency (SNAPSHOT TABLE STABILITY).

    Firebird supports additional transaction parameters besides isolation level, viz. NO RECORD_VERSION/RECORD_VERSION (applicable only to a transaction with READ COMMITTED isolation) and WAIT/NO WAIT. The standard isolation levels can be mapped to Firebird transaction parameters by specifying the properties of the JDBC connection (see more details in the Using Transactions chapter of Jaybird 2.1 JDBC driver Java Programmer’s Manual).

    If your transaction works with more than one query, it is recommended to use the REPEATABLE_READ isolation level to maintain data consistency.

    Read Mode