Skip to content

Commit 0b8822f

Browse files
committed
Avoid double getFlushMode call
1 parent 49ae46d commit 0b8822f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateTransactionManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2016 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.
@@ -452,7 +452,7 @@ protected void doBegin(Object transaction, TransactionDefinition definition) {
452452
if (!definition.isReadOnly() && !txObject.isNewSession()) {
453453
// We need AUTO or COMMIT for a non-read-only transaction.
454454
FlushMode flushMode = session.getFlushMode();
455-
if (FlushMode.isManualFlushMode(session.getFlushMode())) {
455+
if (FlushMode.isManualFlushMode(flushMode)) {
456456
session.setFlushMode(FlushMode.AUTO);
457457
txObject.getSessionHolder().setPreviousFlushMode(flushMode);
458458
}

0 commit comments

Comments
 (0)