I\'m using the tomcat connection pool via JNDI resources.
In the context.xml
:
As documented under Consistent Nonlocking Reads:
If the transaction isolation level is REPEATABLE READ (the default level), all consistent reads within the same transaction read the snapshot established by the first such read in that transaction. You can get a fresher snapshot for your queries by committing the current transaction and after that issuing new queries.
[ deletia ]If you want to see the “freshest” state of the database, use either the READ COMMITTED isolation level or a locking read:
SELECT * FROM t LOCK IN SHARE MODE;
You can set the default transaction isolation level in Tomcat via its Resource@defaultTransactionIsolation attribute.