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)

Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Unassigned
Reporter: Cyril Bouteille
Votes: 1
Watchers: 2

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

InstanceCallbacks are not invoked on classes with inheritance

Created: 01/Sep/09 05:14 PM   Updated: 26/Dec/09 12:58 PM   Resolved: 02/Nov/09 10:58 PM
Component/s: None
Affects Version/s: 1.1.5
Fix Version/s: 2.0.0.m3

SunOS stormbringer 5.10 Generic_118855-33 i86pc i386 i86pc
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)

Forum Thread URL:,4572_offset,0
Datastore: MySQL
Severity: Development

 Description  « Hide
There seems to be an issue subscribing to JDO lifecycle events on classes with inheritance.

I uploaded a test case @,4572_offset,0

Class Hotel extends WebContent implements InstanceCallbacks' jdoPostLoad() but it is not invoked.
We tried the following alternatives which did not work either:
* Hotel implements LoadCallback
* WebContent implements LoadCallback
* pmf.addInstanceLifecycleListener(new LoadLifecycleListener(), new Class[] { Hotel.class }
* pmf.addInstanceLifecycleListener(new LoadLifecycleListener(), new Class[] { WebContent.class }

Callbacks on basic classes w/o inheritance seems to work fine, so it seems there is something going with inheritance...

Sort Order: Ascending order - Click to sort in descending order
Marius Heinzmann added a comment - 19/Oct/09 09:13 PM
Hi everybody,

it seems like error also occurs here with DataNucleus 1.1.3. I don't have the time to dig into this right now, but I will run the testcase provided next week. Until then: Are there any news regarding this problem?


Cyril Bouteille added a comment - 02/Nov/09 09:43 PM
looks like the test case passes now on v2.0.0-m3

Andy Jefferson added a comment - 02/Nov/09 10:58 PM
Test case not run by me and no time to do so, neither has any change been made for this. Since no issue is outstanding (since reported as no problem) then closing the issue

Marius Heinzmann added a comment - 09/Nov/09 12:18 PM
Sorry for the late reply, I was sick.

So after testing this with DataNucleus 1.1.3 and 1.1.6 the problem is still existing.
I'll try and test with the newest DataNucleus 2.0 and will report back soon.

Marius Heinzmann added a comment - 09/Nov/09 09:46 PM
Okay, while implementing an Unit test, I stumbled over the root of my problem:
Any exception that occurs in the jdoPostLoad Method when calling PersistenceManager.detachCopyXXX() is logged as DEBUG level via:

org.datanucleus.state.JDOStateManagerImpl (line 3777):
 NucleusLogger.PERSISTENCE.debug("DETACH ERROR : Error thrown while detaching " +
                    StringUtils.toJVMIDString(myPC) + " (id=" + myID + ")", e);

and the object to detach will still be returned, but in an not fully initialised state and only if you access a member of that detached object the logged exception is propagated.

Needless to say that I was testing by throwing an exception and did not call any method on the object afterwards.

So now it's working. Sorry for the wrong post above.