0

I am trying to set jpa transaction isolation level to read_committed. I am using hibernate 4.1.6. there was a time we could do

Connection connection = session.connection();
connection.setTransactionIsolation(Connection.READ_COMMITTED);

But now that session.connection is not available any more, i am a bit confused. what is the best way of setting isolation on jpa? I am using seam 2.3.

thanks in advance

Ikthiander
  • 3,917
  • 8
  • 37
  • 54

1 Answers1

0

apparently this is one way of doing it:

session.doWork(new Work() {
            @Override
            public void execute(Connection connection) throws SQLException {
                connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
            }
        });

but in seam it will break if you are change the transation isolation level once the transaction started already.

Ikthiander
  • 3,917
  • 8
  • 37
  • 54