i use a custom OpenSessionFilter
Code:
public class OpenSessionFilter extends OpenSessionInViewFilter{
    final static Logger logger = Logger.getLogger(OpenSessionFilter.class.getName());

    protected Session getSession(SessionFactory sessionFactory) throws DataAccessResourceFailureException {
        Session session = SessionFactoryUtils.getSession(sessionFactory, true);
		return session;
    }
}
as what you see, i remove session.setFlushMode(FlushMode.NEVER);
every thing works fine

but i see some project ,such as confluence,petclinc sample
they all use TransactionProxy to do custom transaction on daos like this
Code:
    <bean id="groupDao" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
        <property name="transactionManager">
            <ref local="transactionManager"/>
        </property>
        <property name="target">
            <ref local="confluenceGroupDaoTarget"/>
        </property>
        <property name="transactionAttributes">
            <props>
                <prop key="*">PROPAGATION_REQUIRED</prop>
            </props>
        </property>
    </bean>
here is my question:
what's the different between there two ways
which is good,and would second way get a poor performace?
how to choose the apropos way?

in confluence, some dao seems use way 1 (auto-flush),some use way 2(tran proxy)
it really confuse me...