Polishing

This commit is contained in:
Juergen Hoeller 2014-08-11 15:20:09 +02:00
parent e2aba3d317
commit d6370965eb
2 changed files with 9 additions and 3 deletions

View File

@ -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);

View File

@ -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
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
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) {