Browse Source

Polishing

pull/621/head
Juergen Hoeller 12 years ago
parent
commit
d6370965eb
  1. 4
      spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SpringSessionContext.java
  2. 8
      spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java

4
spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/SpringSessionContext.java

@ -86,8 +86,8 @@ public class SpringSessionContext implements CurrentSessionContext { @@ -86,8 +86,8 @@ public class SpringSessionContext implements CurrentSessionContext {
else if (value instanceof SessionHolder) {
SessionHolder sessionHolder = (SessionHolder) value;
Session session = sessionHolder.getSession();
if (TransactionSynchronizationManager.isSynchronizationActive() &&
!sessionHolder.isSynchronizedWithTransaction()) {
if (!sessionHolder.isSynchronizedWithTransaction() &&
TransactionSynchronizationManager.isSynchronizationActive()) {
TransactionSynchronizationManager.registerSynchronization(
new SpringSessionSynchronization(sessionHolder, this.sessionFactory, false));
sessionHolder.setSynchronizedWithTransaction(true);

8
spring-tx/src/main/java/org/springframework/transaction/support/AbstractPlatformTransactionManager.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2014 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.
@ -1272,6 +1272,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran @@ -1272,6 +1272,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
this.logger = LogFactory.getLog(getClass());
}
/**
* Holder for suspended resources.
* Used internally by {@code suspend} and {@code resume}.
@ -1279,10 +1280,15 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran @@ -1279,10 +1280,15 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
protected static class SuspendedResourcesHolder {
private final Object suspendedResources;
private List<TransactionSynchronization> suspendedSynchronizations;
private String name;
private boolean readOnly;
private Integer isolationLevel;
private boolean wasActive;
private SuspendedResourcesHolder(Object suspendedResources) {

Loading…
Cancel
Save