Skip to content

Commit 2ade773

Browse files
committed
Revise native Hibernate 5 bootstrapping with JTA transaction manager
Closes gh-25858
1 parent 3a610bc commit 2ade773

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spring-orm/src/main/java/org/springframework/orm/hibernate5/LocalSessionFactoryBuilder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -225,6 +225,8 @@ else if (jtaTransactionManager instanceof TransactionManager) {
225225
"Unknown transaction manager type: " + jtaTransactionManager.getClass().getName());
226226
}
227227

228+
getProperties().put(AvailableSettings.TRANSACTION_COORDINATOR_STRATEGY, "jta");
229+
228230
// Hibernate 5.1/5.2: manually enforce connection release mode AFTER_STATEMENT (the JTA default)
229231
try {
230232
// Try Hibernate 5.2

0 commit comments

Comments
 (0)