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

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

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

    空間站

    北極心空

      BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
      15 Posts :: 393 Stories :: 160 Comments :: 0 Trackbacks
    一般這個錯誤是事務引起的,如果確定事務沒有問題,還是有這個錯,可以重寫OpenSessionInViewFilter的2個方法

    在myfaces的wiki里提供了OpenSessionInViewFilter的一個子類如下:
    public class OpenSessionInViewFilter extends org.springframework.orm.hibernate3.support.OpenSessionInViewFilter {
          
            /**
             * we do a different flushmode than in the codebase
             * here
             */
            protected Session getSession(SessionFactory sessionFactory) throws DataAccessResourceFailureException {
                    Session session = SessionFactoryUtils.getSession(sessionFactory, true);
                    session.setFlushMode(FlushMode.COMMIT);
                    return session;
            }
            /**
             * we do an explicit flush here just in case
             * we do not have an automated flush
             */
            protected void closeSession(Session session, SessionFactory factory) {
                    session.flush();
                    super.closeSession(session, factory);
            }
    }

    posted on 2008-11-12 11:21 蘆葦 閱讀(20085) 評論(4)  編輯  收藏 所屬分類: Hibernate

    Feedback

    # re: 解決Hibernate的Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.問題 2009-08-26 23:37 b
    這樣做不太好吧
      回復  更多評論
      

    # re: 解決Hibernate的Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.問題 2010-06-23 23:11 Eric_jiang
    動不動就重寫?  回復  更多評論
      

    # re: 解決Hibernate的Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.問題 2011-07-20 16:59 地球乞丐
    謝謝,我的問題解決了!  回復  更多評論
      

    # re: 解決Hibernate的Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.問題 2012-02-21 11:34 mona
    @地球乞丐
    你怎么解決的  回復  更多評論
      

    主站蜘蛛池模板: 在线观看免费成人| 国产在线精品观看免费观看| 亚洲免费在线视频| 亚洲精品国产成人片| 国产裸体美女永久免费无遮挡| 无码专区一va亚洲v专区在线| 亚洲AV日韩AV无码污污网站| 日韩中文字幕在线免费观看 | 久久久久亚洲AV无码专区桃色| 在线视频亚洲一区| 免费人成网站在线高清| 狠狠热精品免费观看| 亚洲国产成人久久一区久久| 黄色视屏在线免费播放| 亚洲国产另类久久久精品小说 | 一级特黄录像免费播放肥| 国产亚洲成归v人片在线观看 | 日韩免费三级电影| 日日摸夜夜添夜夜免费视频| 中文字幕亚洲不卡在线亚瑟| a级毛片在线免费观看| 亚洲短视频男人的影院| 美女视频黄的全免费视频| 亚洲午夜无码久久久久小说| 国产99视频精品免费视频7| 成年免费a级毛片免费看无码| 亚洲不卡中文字幕无码| 美女视频黄的全免费视频| 黄色免费在线观看网址| 国产亚洲一区二区手机在线观看| 无码AV片在线观看免费| 亚洲熟女精品中文字幕| 亚洲日韩国产成网在线观看| 四虎影视成人永久免费观看视频 | 日本亚洲免费无线码| 免费人成视频在线播放| 亚洲AV中文无码乱人伦下载| 18禁网站免费无遮挡无码中文| 亚洲av色香蕉一区二区三区| 中文字幕久久亚洲一区| 手机看黄av免费网址|