File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
spring-orm/src/main/java/org/springframework/orm/jpa Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2015 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.
@@ -272,7 +272,8 @@ else if (method.getName().equals("unwrap")) {
272272 else if (transactionRequiringMethods .contains (method .getName ())) {
273273 // We need a transactional target now, according to the JPA spec.
274274 // Otherwise, the operation would get accepted but remain unflushed...
275- if (target == null || !TransactionSynchronizationManager .isActualTransactionActive ()) {
275+ if (target == null || (!TransactionSynchronizationManager .isActualTransactionActive () &&
276+ !target .getTransaction ().isActive ())) {
276277 throw new TransactionRequiredException ("No EntityManager with actual transaction available " +
277278 "for current thread - cannot reliably process '" + method .getName () + "' call" );
278279 }
You can’t perform that action at this time.
0 commit comments