`
petacell
  • 浏览: 1018 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

测试电子书是否能打印出代码的颜色

    博客分类:
  • Java
阅读更多

/* blaaaaaaaaaaaaaa
*/
 public Object execute(HibernateCallback action) throws DataAccessException {    
        Session session = (!this.allowCreate)SessionFactoryUtils.getSession(getSessionFactory(),  
                          false);       
        SessionFactoryUtils.getSession(getSessionFactory(),  
                                       getEntityInterceptor(),   
                                       getJdbcExceptionTranslator()));       
        boolean existingTransaction = TransactionSynchronizationManager.hasResource(  
                                        getSessionFactory());     
        if (!existingTransaction && getFlushMode() == FLUSH_NEVER) {     
             session.setFlushMode(FlushMode.NEVER);    
 }        
 try {            
      Object result = action.doInHibernate(session);             
      flushIfNecessary(session, existingTransaction);             
      return result;      
 }      
 catch (HibernateException ex) {            
 throw convertHibernateAccessException(ex);       
 }       
 finally {       
     SessionFactoryUtils.closeSessionIfNecessary(    
     session, getSessionFactory());       
     }   
 }  
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics