<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 閱讀(413) 評論(0)  編輯  收藏 所屬分類: 學習java

    公告

    希望有一天

    我能用鼠標雙擊我的錢包

    然后選中一張100元

    按住“ctrl+c”

    接著不停的“ctrl+v”

    嘻嘻~~~笑醒~~~



    導航

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

    統計

    常用鏈接

    留言簿(6)

    隨筆分類(102)

    隨筆檔案(398)

    文章分類

    文章檔案(10)

    有趣網絡

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲av之男人的天堂网站| 免费大香伊蕉在人线国产| 亚洲AV色香蕉一区二区| a级毛片免费在线观看| 久久久久亚洲av成人无码电影 | 免费国产污网站在线观看| 亚洲一区日韩高清中文字幕亚洲 | 亚洲精华国产精华精华液好用| 国产美女在线精品免费观看| 亚洲AV成人一区二区三区在线看 | 国产亚洲精品AAAA片APP| 手机看片久久国产免费| 偷自拍亚洲视频在线观看| mm1313亚洲精品国产| 99re6在线视频精品免费| 亚洲国产精品嫩草影院在线观看 | 亚洲精品宾馆在线精品酒店| 免费人成在线观看视频播放| 深夜久久AAAAA级毛片免费看| 国产亚洲av片在线观看18女人| 成av免费大片黄在线观看 | 亚洲性无码AV中文字幕| 日本19禁啪啪无遮挡免费动图| 午夜在线亚洲男人午在线| 在线a亚洲v天堂网2019无码| 久久精品免费视频观看| 亚洲国产成人综合| 国产乱弄免费视频| 久久青草免费91观看| 亚洲中文字幕一区精品自拍| 亚洲成a人片在线播放| 在线毛片片免费观看| 亚洲日韩精品无码专区加勒比☆ | 亚洲毛片免费观看| 四虎永久成人免费影院域名| 免费一级毛片无毒不卡| 亚洲欧美成人av在线观看| 亚洲日韩精品A∨片无码| 无限动漫网在线观看免费| xvideos永久免费入口| 亚洲国产高清在线精品一区|