⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hibernatedatabasesession.java

📁 STRUTS数据库项目开发宝典
💻 JAVA
字号:
package org.helpsoft;

import com.finalist.util.log.*;
import org.helpsoft.exception.GenericBusinessException;
import org.helpsoft.servicelocator.*;

/**
 * The <code>DatabaseSessionImpl </code> is used to allow closing of a database session by the client.
 * This way it is possible too keep database sessions open for lazy loading support.

 *
 * @author  cao guangxin  Helpsoft corp.
 * @site www.helpsoft.org or www.relationinfo.com
 * mail:relationinfo@gmail.com
 */
public class HibernateDatabaseSession implements DatabaseSessionService, LocatableService  {
   /**
    * The logger object.
    */
   private static Logger log = LogService.getLogger(HibernateDatabaseSession.class);

   /**
    * Default implementation for the Locatable Service interface.
    */
    public void init() {
    }

   /**
    * Default implementation for the Locatable Service interface.
    */
    public void destroy() {
    }

   /**
    * Close a database session if it is still open.
    *
    */
   public void close() throws GenericBusinessException {
       try {
       org.helpsoft.HibernateSessionHelper.close();
       } catch (Exception e) {
           log.error("Error whil closing the database connection");
           throw new GenericBusinessException(e);
       }
   }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -