Why is hibernate.connection.release_mode after_transaction not recommended for JTA?

While analyzing some of the performance issues in Wildfly 10.1 in high pressure scenarios, I've come to the conclusion that sometimes parallel HTTP streams block each other.

The reason was that in some HTTP requests we are doing two JPQL requests (actually delete and select) and sometimes the second of the two just didn't get the JDBC connection from the pool. (We are using IBM DB2, if that matters ...) This sounded rather ridiculous since the first statement had already received a connection.

After reading the Hibernate docs, I see that the default for hibernate.connection.release_mode

is after_statement

and that is after_transaction

not recommended for JTA applications ...

So ... I have a few questions now:

  • Why after_statement

    does it ever make sense? (unless you have auto_comit, of course ...)
  • Why shouldn't I use after_transaction

    JTA in applications?
  • Is my guess correct, which after_transaction

    should fix the problem described?

Any help is appreciated!

+3


source to share





All Articles