English 中文(简体)
数据Nucleus / NeoDatis - DB的连接似乎关闭,造成可分解物体的损失
原标题:DataNucleus / NeoDatis - DB connection appears to close causing Persistable objects to be lost

利用数据Nucleus 我在<>第二份信息说明()中看到了一个问题。 (从底线进入)。

在试图用<代码>makePersistent(>)读或编辑物体时,我只拿到无效的数值,该信息记录显示,bject不再由顽固的管理人<>管理。 (尽管在<条码>makePersistent()打电话之后,我立即执行这些代用品。)

我的猜测是,“linkion”与我的数据库(NeoDatis in local 嵌入/file manner)正在 封闭,因此,顽固的管理人员停止管理。 但Im刚刚使用数据Nucleusorg.datanucleus.jdo.JDOPersistenceManagerFactory。 建立联系。

为什么会发生这种情况? 我在正确轨道上认为,封闭的连接信息是问题吗?

FQDN 缩短了时间,为了简便而拆除了外壳:

DEBUG DataNucleus.Persistence  - Making object persistent : "a.b.c.User@22a866a9"
INFO  DataNucleus.Persistence  - Managing Persistence of Class : a.b.c.User [Table : (none), InheritanceStrategy : new-table]
DEBUG DataNucleus.Connection  - Connection added to the pool : [o.dn.s.neodatis.ConnectionFactoryImpl$ManagedConnectionImpl@28f337b, null] for key=o.dn.ExecutionContextImpl@59c12050 in factory=ConnectionFactory:tx[o.dn.s.neodatis.ConnectionFactoryImpl@3b626c6d]
DEBUG DataNucleus.Datastore  - Opening NeoDatis ODB for "neodatis:file:database/neodatis_primary_datastore.odb" : org.neodatis.odb.impl.main.LocalODB@13a183d2
DEBUG DataNucleus.Datastore.Persist  - Object "a.b.c.User@22a866a9" being inserted into NeoDatis with all reachable objects
DEBUG DataNucleus.Datastore.Persist  - Object "a.b.c.User@22a866a9" (id="15) persisted to NeoDatis
DEBUG DataNucleus.Datastore  - Committing NeoDatis ODB for "neodatis:file:database/neodatis_primary_datastore.odb" : org.neodatis.odb.impl.main.LocalODB@13a183d2
DEBUG DataNucleus.Connection  - Connection removed from the pool : [o.dn.s.neodatis.ConnectionFactoryImpl$ManagedConnectionImpl@28f337b, null] for key=o.dn.ExecutionContextImpl@59c12050 in factory=ConnectionFactory:tx[o.dn.s.neodatis.ConnectionFactoryImpl@3b626c6d]
DEBUG DataNucleus.Connection  - The connection has been closed : [o.dn.s.neodatis.ConnectionFactoryImpl$ManagedConnectionImpl@28f337b, null]
DEBUG DataNucleus.Reachability  - Performing check of objects for "persistence-by-reachability" (commit) ...
DEBUG DataNucleus.Cache  - Object "a.b.c.User@22a866a9" (id="15") added to Level 2 cache (loadedFlags="[YYYYYYY]", relationFields="null")
DEBUG DataNucleus.Transaction  - Committing [DataNucleus Transaction, ID=Xid=, enlisted resources=[]]
DEBUG DataNucleus.Lifecycle  - Object "a.b.c.User@22a866a9" (id="15") has a lifecycle change : "P_NEW"->"HOLLOW"
DEBUG DataNucleus.Transaction  - Object "a.b.c.User@22a866a9" (id="15") being evicted from transactional cache
DEBUG DataNucleus.Transaction  - Transaction committed in 7 ms
DEBUG DataNucleus.Lifecycle  - Object "a.b.c.User@22a866a9" (id="15") has a lifecycle change : "HOLLOW"->"P_NONTRANS"
DEBUG DataNucleus.Persistence  - Fetching object "a.b.c.User@22a866a9" (id=15) fields [authorities,createdFromIP,dateCreated,password,timeZoneID,username]
DEBUG DataNucleus.Datastore.Retrieve  - Object "a.b.c.User@22a866a9" (id="15") being retrieved from NeoDatis
DEBUG DataNucleus.Connection  - Connection added to the pool : [o.dn.s.neodatis.ConnectionFactoryImpl$ManagedConnectionImpl@39673d71, null] for key=o.dn.ExecutionContextImpl@59c12050 in factory=ConnectionFactory:tx[o.dn.s.neodatis.ConnectionFactoryImpl@3b626c6d]
DEBUG DataNucleus.Datastore  - Opening NeoDatis ODB for "neodatis:file:database/neodatis_primary_datastore.odb" : org.neodatis.odb.impl.main.LocalODB@621f6c18
DEBUG DataNucleus.Datastore  - Committing NeoDatis ODB for "neodatis:file:database/neodatis_primary_datastore.odb" : org.neodatis.odb.impl.main.LocalODB@621f6c18
DEBUG DataNucleus.Connection  - Connection removed from the pool : [o.dn.s.neodatis.ConnectionFactoryImpl$ManagedConnectionImpl@39673d71, null] for key=o.dn.ExecutionContextImpl@59c12050 in factory=ConnectionFactory:tx[o.dn.s.neodatis.ConnectionFactoryImpl@3b626c6d]
DEBUG DataNucleus.Connection  - The connection has been closed : [o.dn.s.neodatis.ConnectionFactoryImpl$ManagedConnectionImpl@39673d71, null]
INFO  DataNucleus.Persistence  - Request to populate fields of a.b.c.User@22a866a9 but this object is no longer managed by NeoDatis so replacing with a.b.c.User@7cf1cdfb
DEBUG DataNucleus.Datastore.Retrieve  - Execution Time = 5 ms
最佳回答

I love learning new things, but why does it have to be such a painful process at times? Ok right, this is an answer, not a question...

因此,我删除了一条有助于其他人看到问题的关键性航标线:

1795 [main] INFO DataNucleus.Transaction  - Non-tx updates are being committed to the datastore

问题在于,我是在交易之外采取行动。

Actually that was only the first step, what was really happening was that I was performing the actions against a different PersistenceManager than the transaction was started on.

我在春季管理交易,但我打电话到<条码>jdoPersistenceManager.getPersistenceManager(,产生了新的<条码>PersistenceManager(详细总结会议)。

我本应该利用春天获得春季交易确定的<代码>PersistenceManager。 归根结底,这意味着在我的农业部物体中,将<条码>延伸至JdoDaoSupport。

现在我感觉到了聪明,但在某种程度上,学习永远不会结束。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...