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

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

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

    Loading...

    java .net

    google app engine for java:org.datanucleus.exceptions.NucleusUserException

    開發中遇到這個異常:
    NestedThrowablesStackTrace:
    Attempt was made to manually set the id component of a Key primary key. If you want to control the value of the primary key, set the name component instead.
    org.datanucleus.exceptions.NucleusUserException: Attempt was made to manually set the id component of a Key primary key. If you want to control the value of the primary key, set the name component instead.


    原來的修改代碼是這樣些的:
    public void attachDirty(UrlTarget instance) {
            PersistenceManager pm = null;
            try {
               
                pm = PMF.get().getPersistenceManager();
                UrlTarget ut = (UrlTarget) pm.getObjectById(UrlTarget.class, instance.getId());
                ut.setName(instance.getName());
                ut.setRemark(instance.getRemark());
                ut.setUrl(instance.getUrl());
               pm.makePersistent(ut);
            } catch(Exception ex){
                ex.printStackTrace();
            }finally {
                if(pm != null)pm.close();
            }
           
        }

    public UrlTarget findById(Long id) {
            PersistenceManager pm = PMF.get().getPersistenceManager();
            try{
                return (UrlTarget) pm.getObjectById(UrlTarget.class, id);
            }catch(Exception ex){
                ex.printStackTrace();
            }finally {
                pm.close();
            }
            return null;
        }
    在利用findById方法得到對象后修改,但是findById中pm已經關閉,這就是錯誤的原因了

    posted on 2009-10-14 18:01 閱讀(420) 評論(0)  編輯  收藏 所屬分類: 學習java

    公告

    希望有一天

    我能用鼠標雙擊我的錢包

    然后選中一張100元

    按住“ctrl+c”

    接著不停的“ctrl+v”

    嘻嘻~~~笑醒~~~



    導航

    <2009年10月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    統計

    常用鏈接

    留言簿(6)

    隨筆分類(102)

    隨筆檔案(398)

    文章分類

    文章檔案(10)

    有趣網絡

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 四虎免费久久影院| 亚洲一区无码中文字幕| 日韩免费码中文在线观看| 亚洲色WWW成人永久网址| 5g影院5g天天爽永久免费影院| 久久亚洲最大成人网4438| 五月婷婷亚洲综合| 91精品视频在线免费观看| 亚洲国产精品99久久久久久| 亚洲精品国产精品乱码不99 | 少妇亚洲免费精品| 91久久亚洲国产成人精品性色 | 国产免费爽爽视频在线观看 | 日韩亚洲不卡在线视频中文字幕在线观看| 国产精品久久香蕉免费播放| 成人性生交大片免费看好 | 国产四虎免费精品视频| 一级毛片正片免费视频手机看| 亚洲无圣光一区二区| 久久久久亚洲AV成人网人人软件| 最近在线2018视频免费观看| 一级毛片视频免费观看 | 在线免费观看亚洲| 一级午夜a毛片免费视频| 亚洲资源最新版在线观看| 亚洲国产精品福利片在线观看| 天天操夜夜操免费视频| 久久99青青精品免费观看| 黄色片网站在线免费观看| 亚洲专区中文字幕| 亚洲国产成人久久精品动漫| 免费A级毛片无码A| 国产大片线上免费观看| 国产白丝无码免费视频| 国产三级在线免费观看| 亚洲精品无码久久久久久| 亚洲成a人片77777群色| 亚洲AV无码专区国产乱码4SE| 亚洲国产av无码精品| 成人免费无码精品国产电影| 亚色九九九全国免费视频|