DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCCORE-816
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Trivial Trivial
Assignee: Unassigned
Reporter: Stephen More
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Core

Improve Error Reporting when detach fails

Created: 01/Mar/12 05:03 PM   Updated: 03/Aug/12 09:34 PM   Resolved: 01/Mar/12 07:12 PM
Component/s: Code Structure
Affects Version/s: 3.0.7
Fix Version/s: 3.0.10, 3.1.0.m1


 Description  « Hide
platform/core/trunk/src/java/org/datanucleus/state/JDOStateManager.java

NucleusLogger.PERSISTENCE.debug("DETACH ERROR : Error thrown while detaching "

Should be changed to:
NucleusLogger.PERSISTENCE.warn("DETACH ERROR : Error thrown while detaching "

I occasionally get "was not detached correctly" in production and can not reproduce it in dev.
Having this error show up as a warn or error will help debug what the real issue is that I am having.

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 01/Mar/12 07:12 PM
SVN trunk and branches/3.0 change that to warn and ask the user for a valid testcase ...

Stephen More added a comment - 23/Mar/12 02:51 PM
Thanks to version 3.1.0.m1 I was able to see this in dev:

2012-03-23 09:43:17,511 WARN [Retrieve:96] Found type=class model.V but abstract and more than 1 concrete subclass ([model.F, model.B, model.P, model.L, model.S]). Really you need a discriminator to help identifying the type. Choosing class model.S


2012-03-23 09:43:17,572 INFO [Retrieve:77] Object with id "41" not found !
2012-03-23 09:43:17,574 WARN [Persistence:106] DETACH ERROR : Error thrown while detaching model.S@4f675ff4 (id=41). Provide a testcase that demonstrates this
No such database row
org.datanucleus.exceptions.NucleusObjectNotFoundException: No such database row
        at org.datanucleus.store.rdbms.request.FetchRequest.execute(FetchRequest.java:351)
        at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.fetchObject(RDBMSPersistenceHandler.java:315)


It turns out that model.S was not the right choice.

Stephen More added a comment - 03/Aug/12 09:34 PM
Found another case:

2012-08-03 15:26:20,889 WARN [Persistence:106] DETACH ERROR : Error thrown while detaching Activity@3b410317 (id=77104) and provide a valid testcase
Field "File.blocks" has been defined as "mapped-by" field "Block.file" yet this is of an incorrect type (DbFile). The field that is set as the "mapped-by" must be of type "File"
org.datanucleus.exceptions.NucleusUserException: Field "File.blocks" has been defined as "mapped-by" field "Block.file" yet this is of an incorrect type (DbFile). The field that is set as the "mapped-by" must be of type "File"