title: Transactional annotation slows down the performance than HibernateDAOSupport
body: <p>I am exporting a report in my code, I am using <code>HibernateDAOSupport</code> and the method is not annotated with <code>@Transactional</code>. So when the request comes from the UI then automatically Transaction is created and the report is exported in 2 mins.
  But when I try to use thread, so I had to put annotation <code>@Transactional</code>, otherwise I get an error of LazyInitialization as no Transcaction is present.
  So when I put <code>@Transactional</code> then the same report takes time 2.4 mins. This time keeps increasing and sometimes it take double of the time without <code>@Transactional</code>
  I am not sure why it takes time when I put annotation <code>@Transactional</code></p>
  
  <p>The main class:
  <strong>CommonDAO</strong></p>
  
  <pre><code>public class CommonDAO extends HibernateDaoSupport
  private HibernateTransactionManager txnManager;
  
      public void setTxnManager(HibernateTransactionManager txnManager) {
          this.txnManager = txnManager;
      }
  public List executeSQLQueryPaging(final String hql,
              final Object[] params, final Integer[] pagingParam) throws ServiceException {
          List results = null;
          results = getHibernateTemplate().executeFind(new HibernateCallback() {
  
              public Object doInHibernate(Session session) {
                  SQLQuery query = session.createSQLQuery(hql);
                  if (params != null) {
                      for (int i = 0; i &lt; params.length; i++) {
                          query.setParameter(i, params[i]);
                      }
                  }
                  query.setFirstResult(pagingParam[0]);
                  query.setMaxResults(pagingParam[1]);
                  return query.list();
              }
          });
          return results;
      }
  </code></pre>
  
  <p><strong>ModuleDAO extends CommonDAO</strong></p>
  
  <pre><code>public List getReportData{
  executeSQLQueryPaging();
  ...
  return list}
  </code></pre>
  
  <p><strong>Service</strong></p>
  
  <pre><code>public List getReportData(){
  .....
  return ModuleDAO.getReportData();
  }
  </code></pre>
  
  <p>If I put @Transactional at service layer then the performance detriorates, or else it is faster if executed from web.</p>