2012-01-28 2 views
1

私は次のエラーメッセージを取得しています閉鎖されました:org.datanucleus.exceptions.NucleusUserException:オブジェクト・マネージャーは、

org.datanucleus.exceptions.NucleusUserException:オブジェクトマネージャは

を閉じている私は、最大読んだことがあります私はそれで見つけることができるすべてが、私はまだ理解していない 何が原因です。 がこの単純な問題を解決できない場合、私はあきらめてSQL DBに切り替えようとしています。はい、私は午後を閉じています:

静的な無効persistAllは{

PersistenceManager pm = PMF.get().getPersistenceManager(); 
Transaction tx = pm.currentTransaction(); 
try { 
    tx.begin(); 
    for (Object o : objs) 
    pm.makePersistent(o); 
    //pm.makePersistentAll(objs); 
    tx.commit(); 
} finally { 
    if (tx.isActive()) 
    tx.rollback(); 
    pm.close(); 
} 

}

私は私のものの着脱式を作った、と私は私のオブジェクトを外れた場所 I([] OBJSオブジェクト)私がしなければならないと思った。今何ができますか?私は完全にこれに固執している! DataNucleus、助けてください!

JG

私はグループを取得し、自分のアプリケーションをデバッグするとき、私は桟橋から次の警告エラーを取得し、デフォルトに<>フィールドを店のリストを追加しようとしています。私は、物を取ったときに、代わりにフィールドに触れてみる必要があります。 (?)

Jan 29, 2012 1:29:30 PM org.datanucleus.store.appengine.MetaDataValidator warn 
WARNING: Meta-data warning for com.foobar.foo.Store.sales: The datastore does not support joins and therefore cannot honor requests to place related objects in the default fetch group. The field will be fetched lazily on first access. You can modify this warning by setting the datanucleus.appengine.ignorableMetaDataBehavior property in your config. A value of NONE will silence the warning. A value of ERROR will turn the warning into an exception. 
Jan 29, 2012 1:29:30 PM org.datanucleus.store.appengine.MetaDataValidator warn 
WARNING: Meta-data warning for com.foobar.foo.Store.shipments: The datastore does not support joins and therefore cannot honor requests to place related objects in the default fetch group. The field will be fetched lazily on first access. You can modify this warning by setting the datanucleus.appengine.ignorableMetaDataBehavior property in your config. A value of NONE will silence the warning. A value of ERROR will turn the warning into an exception. 
Jan 29, 2012 1:29:30 PM org.datanucleus.store.appengine.MetaDataValidator warn 
WARNING: Meta-data warning for com.foobar.foo.Store.users: The datastore does not support joins and therefore cannot honor requests to place related objects in the default fetch group. The field will be fetched lazily on first access. You can modify this warning by setting the datanucleus.appengine.ignorableMetaDataBehavior property in your config. A value of NONE will silence the warning. A value of ERROR will turn the warning into an exception. 

私は店がデフォルトのグループが、それはそれらのサブフィールドの一部かもしれ動作していないフェッチするので、ヌル(しかしないデバッガで確認したにも関わらずpm.makePersistent(store)からNullPointerExceptionを取得しています何らかの理由で(?)

答えて

5

私はあなたの問題が遅延ロードされているフィールドの値にアクセスしようとしていると考えています。 pmを閉じてオブジェクトを取り外す前に、そのようなコンテンツを取得またはアクセス(「タッチ」)していることを確認してください。所有されている1対1の関係では、子フィールドを「デフォルトのフェッチグループ」に追加して、取得して親にロードすることもできます。ここでは、この上の議論の多くのがあります

http://code.google.com/appengine/docs/java/datastore/jdo/relationships.html#Owned_One_to_One_Relationships

+0

は、ご返信いただきありがとうございますが、App Engineの上に示すようにすると、私はデフォルトを使用せていませんが、私のリストのグループをフェッチ<>オブジェクト属性。私は本当にList <>に触れていて、それを切り離して、なぜpm.makePersistent()のときにNullPointerExceptionを受け取っているのかわからない。どんな助けでも大歓迎です。 JG – johngoche9999

+1

はい、m:1の所有関係では、 '結合をサポートしていません'という警告が表示され、子コレクションにデフォルトのフェッチグループ指定を使用できません。 (申し訳ありませんが、私はあなたの説明でそれを逃した)。したがって、pmと、アクセスする必要のある子オブジェクト内の遅延ロードされたフィールドを閉じる前に、コレクション内の子に明示的にアクセスする必要があります。 –