title: Spring 3.1 + Hibernate 4.1 Propagation.Supports issue
body: <p>I'm migrating my project from Spring 3.0 +hibernate 3.6.x to S3.1 + H4.1</p>
  
  <p>my new code is the following</p>
  
  <pre><code>    &lt;context:component-scan base-package="x.y.z"&gt;
  &lt;/context:component-scan&gt;
  
  &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
      &lt;property name="dataSource" ref="dataSource"/&gt;
      &lt;property name="hibernateProperties"&gt;
   &lt;props&gt;
      &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.x&lt;/prop&gt; 
      &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt; 
      &lt;prop key="hibernate.hbm2ddl.auto"&gt;update&lt;/prop&gt; 
      &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt; 
    &lt;/props&gt;
       &lt;/property&gt;
          &lt;property name="annotatedClasses"&gt;
        &lt;list&gt;
          &lt;value&gt;x.y.z.entities.Student&lt;/value&gt;        
           &lt;/list&gt;
      &lt;/property&gt;
    &lt;/bean&gt;
  
  &lt;bean id="transactionManager" 
              class="org.springframework.orm.hibernate4.HibernateTransactionManager"&gt;
      &lt;property name="sessionFactory" ref="sessionFactory"/&gt;
    &lt;/bean&gt;
  
  &lt;aop:config&gt;
      &lt;aop:pointcut id="daoServicePoint" 
              expression="execution(* x.y.z.StudentDao.*(..))"/&gt;
      &lt;aop:advisor advice-ref="txAdvice" pointcut-ref="daoServicePoint"/&gt;
    &lt;/aop:config&gt;
  
    &lt;tx:advice id="txAdvice" transaction-manager="transactionManager"&gt;
      &lt;tx:attributes&gt;
        &lt;tx:method name="save*" propagation="REQUIRED"/&gt;
         &lt;tx:method name="update*" propagation="REQUIRED"/&gt;
         &lt;tx:method name="delete*" propagation="REQUIRED"/&gt;
       &lt;tx:method name="get*" propagation="SUPPORTS" read-only="true"/&gt;
      &lt;/tx:attributes&gt;
    &lt;/tx:advice&gt; 
  </code></pre>
  
  <p>When running getStudent method marker as SUPPORTS and read only I'm getting </p>
  
  <pre><code>org.hibernate.HibernateException: No Session found for current thread
      at org.springframework.orm.hibernate4.SpringSessionContext.currentSession(SpringSessionContext.java:97)
      at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:1024)
  </code></pre>
  
  <p>It used to be ok with Spring 3.0 and Hibernate 3.6.x now it was changed. I undestood from Spring forums that mow I need mark transaction REQUIRED if I need to use <code>sessionFactory.getCurrentSession();</code></p>
  
  <p>I used lower level technique in order to get maximum concurrent speed in my code.
  When performing operations which require several get/save/update/ queries i did it the following way:</p>
  
  <ol>
  <li>called method  marked as <code>SUPPORTS</code>.</li>
  <li>Performed all get queries which are also marked as <code>SUPPORTS</code> inside
  first method.</li>
  <li>then started queries which marked as <code>REQUIRED</code> inside the same method and this is a point
  where my roll-able back transaction begins.</li>
  </ol>
  
  <p>I got good performance improvement using this technique, but marking all my methods as REQUIRED destroys it.</p>
  
  <p>How can work around it? </p>