Revise native Hibernate 5 bootstrapping with JTA transaction manager

Closes gh-25858
This commit is contained in:
Juergen Hoeller
2020-10-06 17:49:43 +02:00
parent 3a610bcf0d
commit 2ade77304a

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -225,6 +225,8 @@ public class LocalSessionFactoryBuilder extends Configuration {
"Unknown transaction manager type: " + jtaTransactionManager.getClass().getName());
}
getProperties().put(AvailableSettings.TRANSACTION_COORDINATOR_STRATEGY, "jta");
// Hibernate 5.1/5.2: manually enforce connection release mode AFTER_STATEMENT (the JTA default)
try {
// Try Hibernate 5.2