From: Juergen H. <jho...@us...> - 2008-10-23 09:30:02
|
Update of /cvsroot/springframework/spring/src/org/springframework/orm/hibernate3 In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28517/src/org/springframework/orm/hibernate3 Modified Files: HibernateTransactionManager.java Log Message: fixed HibernateTransactionManager's "earlyFlushBeforeCommit" feature to not switch to FlushMode.NEVER too early Index: HibernateTransactionManager.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/orm/hibernate3/HibernateTransactionManager.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** HibernateTransactionManager.java 7 May 2008 10:55:41 -0000 1.41 --- HibernateTransactionManager.java 23 Oct 2008 09:25:39 -0000 1.42 *************** *** 298,308 **** /** * Set whether to perform an early flush before proceeding with a commit. ! * <p>Default is "false", performing an implicit flush as part of the ! * actual commit step. Switch this to "true" in order to enforce an ! * explicit flush before the before-commit synchronization phase, making ! * flushed state visible to <code>beforeCommit</code> callbacks of registered * {@link org.springframework.transaction.support.TransactionSynchronization} ! * objects. ! * <p>Such explicit flush behavior is also consistent with Spring-driven * flushing in a JTA transaction environment, so may also be enforced for * consistency with JTA transaction behavior. --- 298,311 ---- /** * Set whether to perform an early flush before proceeding with a commit. ! * <p>Default is "false", performing an implicit flush as part of the actual ! * commit step. Switch this to "true" in order to enforce an explicit flush ! * at the end of each successfully passed transaction boundary. ! * <p>This can be used to automatically make Hibernate-driven database changes ! * visible at the end of inner transactions, e.g. in order to have JDBC access ! * code operating on the flushed data later on in the same transaction. ! * <p>An early flush happens before the before-commit synchronization phase, ! * making flushed state visible to <code>beforeCommit</code> callbacks of registered * {@link org.springframework.transaction.support.TransactionSynchronization} ! * objects. Such explicit flush behavior is consistent with Spring-driven * flushing in a JTA transaction environment, so may also be enforced for * consistency with JTA transaction behavior. *************** *** 640,644 **** } finally { ! session.setFlushMode(FlushMode.NEVER); } } --- 643,649 ---- } finally { ! if (status.isNewTransaction()) { ! session.setFlushMode(FlushMode.NEVER); ! } } } |