<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)

    有趣網絡

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 日韩在线永久免费播放| 一区二区三区精品高清视频免费在线播放| a一级爱做片免费| 亚洲国产精品综合久久网络| 猫咪免费人成在线网站 | 四虎影视久久久免费观看| 国产免费观看黄AV片| 国产精品亚洲五月天高清| 国产成人免费a在线资源| 久久水蜜桃亚洲AV无码精品| 免费国产真实迷j在线观看| 理论秋霞在线看免费| 永久亚洲成a人片777777| 黄色网址在线免费| 亚洲国产视频一区| 毛片高清视频在线看免费观看| 亚洲国产精品成人AV在线| 四虎永久免费观看| 成在线人视频免费视频| 亚洲专区在线视频| 最近的免费中文字幕视频| 日韩成人精品日本亚洲| 伊人久久大香线蕉亚洲五月天 | 久久国内免费视频| 久久人午夜亚洲精品无码区 | 亚洲人AV永久一区二区三区久久| 一区在线免费观看| 久久久久亚洲精品日久生情| 毛片免费视频在线观看| 牛牛在线精品观看免费正| 亚洲区小说区激情区图片区| 30岁的女人韩剧免费观看| 亚洲aⅴ天堂av天堂无码麻豆| 国产亚洲精午夜久久久久久| 久9这里精品免费视频| 亚洲欧美日韩久久精品| 国产成人精品日本亚洲专区61| 1000部啪啪未满十八勿入免费| 色天使亚洲综合一区二区| 久久精品国产亚洲AV麻豆不卡| 毛片免费视频播放|