<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 34, 文章 - 1, 評論 - 2, 引用 - 0
    數據加載中……

    hibernate use Websphere datasource

    reference  url:
        http://www.ibm.com/developerworks/websphere/techjournal/0609_alcott/0609_alcott.html

    when  webSphere  application server  startup,  hibernate uses  WebSphere datasource.
    step by  step:

         1  coding  statup  constom service

           import javax.management.Notification;
          import javax.management.NotificationFilterSupport;
          import javax.management.NotificationListener;
          import javax.management.ObjectName;
          
          public class WebsphereStartup implements CustomService,NotificationListener {
            public void initialize(Properties arg0) throws Exception {    
               NotificationFilterSupport filter = new NotificationFilterSupport();   
               filter.enableType(NotificationConstants.TYPE_J2EE_STATE_RUNNING);
               ObjectName target = new ObjectName("WebSphere:*,type=Server");   
               AdminServiceFactory.getAdminService().addNotificationListenerExtended(
                target,
                this,
                filter,
                null);
           } 
           public void shutdown() throws Exception {
             // When  was  shutdown,  this  method  is  executed
            
           } 
           public void handleNotification(Notification notification, Object handback) {
             //  write  init  code  here
             init();
           }
          }

         2  modify    hibernate config file  hibernate.cfg.xml

                         <property name="hibernate.connection.datasource">data  source  jndi</property>
                        <property name="hibernate.connection.username">name</property>
                         <property name="hibernate.connection.password">password</property>
                         <property name="hibernate.session_factory_name">HibernateSessionFactory</property>  
                          <property name="connection.autocommit">false</property>
                        <property name="net.sf.hibernate.transaction.JTATransactionFactory">net.sf.hibernate.transaction.WebSphereTransactionManagerLookup</property>
                          <property name="show_sql">false</property>
                         <property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>

                  注意:如果是非事務性數據源  那么在hibernate.cfg.xml  必須設置 <property name="connection.autocommit">false</property>
                          為false
                               
         3   create  datasource   jndi  on  was
                 如果是非事務性數據源,在建立數據源時,也要設置為非事務性數據源。
          4    config  custom service  bean  on Websphere
                 was console >servers> application server > server1>manage>custom service >new
           5 start Server

    posted on 2009-12-18 09:19 河馬虎 閱讀(550) 評論(0)  編輯  收藏 所屬分類: WebSphere

    主站蜘蛛池模板: 亚洲一区二区免费视频| 91亚洲精品视频| 在线观看免费亚洲| 毛片免费在线观看网站| 亚洲va精品中文字幕| 最近2022中文字幕免费视频| 亚洲av一综合av一区| 中文字幕免费不卡二区| 亚洲av永久无码精品古装片| 七色永久性tv网站免费看| 亚洲an天堂an在线观看| 精品国产污污免费网站| 久久精品国产亚洲AV无码娇色 | 亚洲综合另类小说色区色噜噜| 美女被免费视频网站a| 亚洲日韩国产一区二区三区| 99久久婷婷免费国产综合精品| 亚洲欧洲日产国码无码久久99| 免费一级不卡毛片| 亚洲精品影院久久久久久| 成人黄软件网18免费下载成人黄18免费视频 | 99视频在线免费看| 91亚洲精品自在在线观看| 国语成本人片免费av无码 | www在线观看免费视频| 亚洲无人区一区二区三区| 蜜桃AV无码免费看永久| 亚洲欧美aⅴ在线资源| 亚洲精品国产成人影院| 香蕉免费一区二区三区| 亚洲国产综合精品| 免费人成视网站在线观看不卡| 波霸在线精品视频免费观看| 久久久久亚洲AV无码观看| 免费看大美女大黄大色| fc2成年免费共享视频网站| 久久亚洲AV成人出白浆无码国产 | 亚洲高清免费视频| 亚洲卡一卡2卡三卡4麻豆| 亚洲福利视频一区二区| 久久国产乱子免费精品|