Polishing
Issue: SPR-11291
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package org.springframework.orm.hibernate3;
|
||||
|
||||
import java.sql.Connection;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.hibernate.ConnectionReleaseMode;
|
||||
@@ -30,6 +29,7 @@ import org.hibernate.SessionFactory;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.exception.GenericJDBCException;
|
||||
import org.hibernate.impl.SessionImpl;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
@@ -110,7 +110,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
|
||||
* support nested transactions! Hence, do not expect Hibernate access code to
|
||||
* semantically participate in a nested transaction.</i>
|
||||
*
|
||||
* <p>Requires Hibernate 3.6 or later, as of Spring 4.0.
|
||||
* <p>Requires Hibernate 3.6.x, as of Spring 4.0.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 1.2
|
||||
|
||||
@@ -88,7 +88,7 @@ import org.springframework.util.StringUtils;
|
||||
* {@link org.springframework.orm.hibernate3.support.OpenSessionInViewFilter} /
|
||||
* {@link org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor}.
|
||||
*
|
||||
* <p>Requires Hibernate 3.6 or later, as of Spring 4.0.
|
||||
* <p>Requires Hibernate 3.6.x, as of Spring 4.0.
|
||||
* Note that this factory will use "on_close" as default Hibernate connection
|
||||
* release mode, unless in the case of a "jtaTransactionManager" specified,
|
||||
* for the reason that this is appropriate for most Spring-based applications
|
||||
|
||||
@@ -20,7 +20,6 @@ import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import javax.transaction.Status;
|
||||
import javax.transaction.Transaction;
|
||||
@@ -57,6 +56,7 @@ import org.hibernate.exception.DataException;
|
||||
import org.hibernate.exception.JDBCConnectionException;
|
||||
import org.hibernate.exception.LockAcquisitionException;
|
||||
import org.hibernate.exception.SQLGrammarException;
|
||||
|
||||
import org.springframework.core.NamedThreadLocal;
|
||||
import org.springframework.dao.CannotAcquireLockException;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
@@ -91,7 +91,7 @@ import org.springframework.util.Assert;
|
||||
* and {@link HibernateTransactionManager}. Can also be used directly in
|
||||
* application code.
|
||||
*
|
||||
* <p>Requires Hibernate 3.6 or later, as of Spring 4.0.
|
||||
* <p>Requires Hibernate 3.6.x, as of Spring 4.0.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 1.2
|
||||
@@ -618,10 +618,12 @@ public abstract class SessionFactoryUtils {
|
||||
*/
|
||||
public static void applyTransactionTimeout(Criteria criteria, SessionFactory sessionFactory) {
|
||||
Assert.notNull(criteria, "No Criteria object specified");
|
||||
SessionHolder sessionHolder =
|
||||
(SessionHolder) TransactionSynchronizationManager.getResource(sessionFactory);
|
||||
if (sessionHolder != null && sessionHolder.hasTimeout()) {
|
||||
criteria.setTimeout(sessionHolder.getTimeToLiveInSeconds());
|
||||
if (sessionFactory != null) {
|
||||
SessionHolder sessionHolder =
|
||||
(SessionHolder) TransactionSynchronizationManager.getResource(sessionFactory);
|
||||
if (sessionHolder != null && sessionHolder.hasTimeout()) {
|
||||
criteria.setTimeout(sessionHolder.getTimeToLiveInSeconds());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,10 +43,7 @@ import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
* Subclass of Spring's standard LocalSessionFactoryBean for Hibernate,
|
||||
* supporting JDK 1.5+ annotation metadata for mappings.
|
||||
*
|
||||
* <p>Note: As of Spring 4.0, this class requires Hibernate 3.6 or later,
|
||||
* with the Java Persistence API present.
|
||||
* supporting annotation metadata for mappings.
|
||||
*
|
||||
* <p>Example for an AnnotationSessionFactoryBean bean definition:
|
||||
*
|
||||
@@ -69,7 +66,7 @@ import org.springframework.util.ClassUtils;
|
||||
* <property name="packagesToScan" value="test.package"/>
|
||||
* </bean></pre>
|
||||
*
|
||||
* <p>Requires Hibernate 3.6 or later, as of Spring 4.0.
|
||||
* <p>Requires Hibernate 3.6.x, as of Spring 4.0.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 1.2.2
|
||||
|
||||
Reference in New Issue
Block a user