Issue Details (XML | Word | Printable)

Key: JDO-70
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Erik Bengtson
Reporter: Craig Russell
Votes: 0
Watchers: 0
Operations

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

NullPointerException in jdoPreClear

Created: 11/Jun/05 06:12 AM   Updated: 23/Apr/06 02:38 AM
Return to search
Component/s: tck2
Affects Version/s: None
Fix Version/s: JDO 2 beta

Time Tracking:
Not Specified

Environment: JPOX

Resolution Date: 23/Apr/06 02:38 AM


 Description  « Hide
RUN CallingJdoPreclear.test ERROR
    [java] [FATAL] tck - Exception during setUp or runtest: <org.jpox.exceptions.CommitStateTransitionException: A database transaction has been committed, but the following exceptions were thrown while transitioning the state of the JDO objects participating in the transaction.
    [java] NestedThrowables:
    [java] java.lang.NullPointerException>org.jpox.exceptions.CommitStateTransitionException: A database transaction has been committed, but the following exceptions were thrown while transitioning the state of the JDO objects participating in the transaction.
    [java] at org.jpox.AbstractPersistenceManager.postCommit(AbstractPersistenceManager.java:2846)
    [java] at org.jpox.NonmanagedTransaction.commit(NonmanagedTransaction.java:478)
    [java] at org.apache.jdo.tck.api.instancecallbacks.CallingJdoPreclear.test(CallingJdoPreclear.java:122)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [java] at java.lang.reflect.Method.invoke(Method.java:324)
    [java] at junit.framework.TestCase.runTest(TestCase.java:154)
    [java] at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:181)
    [java] at junit.framework.TestResult$1.protect(TestResult.java:106)
    [java] at junit.framework.TestResult.runProtected(TestResult.java:124)
    [java] at junit.framework.TestResult.run(TestResult.java:109)
    [java] at junit.framework.TestCase.run(TestCase.java:118)
    [java] at junit.framework.TestSuite.runTest(TestSuite.java:208)
    [java] at junit.framework.TestSuite.run(TestSuite.java:203)
    [java] at junit.framework.TestSuite.runTest(TestSuite.java:208)
    [java] at junit.framework.TestSuite.run(TestSuite.java:203)
    [java] at junit.textui.TestRunner.doRun(TestRunner.java:116)
    [java] at junit.textui.TestRunner.doRun(TestRunner.java:109)
    [java] at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:112)
    [java] at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:90)
    [java] NestedThrowablesStackTrace:
    [java] java.lang.NullPointerException
    [java] at org.apache.jdo.tck.pc.instancecallbacks.InstanceCallbackClass.jdoPreClear(InstanceCallbackClass.java:157)
    [java] at org.jpox.state.StateManagerImpl.clearFieldsByNumbers(StateManagerImpl.java:963)
    [java] at org.jpox.state.StateManagerImpl.clearNonPrimaryKeyFields(StateManagerImpl.java:952)
    [java] at org.jpox.state.PersistentClean.transitionCommit(PersistentClean.java:82)
    [java] at org.jpox.state.StateManagerImpl.postCommit(StateManagerImpl.java:3706)
    [java] at org.jpox.AbstractPersistenceManager.postCommit(AbstractPersistenceManager.java:2832)
    [java] at org.jpox.NonmanagedTransaction.commit(NonmanagedTransaction.java:478)
    [java] at org.apache.jdo.tck.api.instancecallbacks.CallingJdoPreclear.test(CallingJdoPreclear.java:122)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [java] at java.lang.reflect.Method.invoke(Method.java:324)
    [java] at junit.framework.TestCase.runTest(TestCase.java:154)
    [java] at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:181)
    [java] at junit.framework.TestResult$1.protect(TestResult.java:106)
    [java] at junit.framework.TestResult.runProtected(TestResult.java:124)
    [java] at junit.framework.TestResult.run(TestResult.java:109)
    [java] at junit.framework.TestCase.run(TestCase.java:118)
    [java] at junit.framework.TestSuite.runTest(TestSuite.java:208)
    [java] at junit.framework.TestSuite.run(TestSuite.java:203)
    [java] at junit.framework.TestSuite.runTest(TestSuite.java:208)
    [java] at junit.framework.TestSuite.run(TestSuite.java:203)
    [java] at junit.textui.TestRunner.doRun(TestRunner.java:116)
    [java] at junit.textui.TestRunner.doRun(TestRunner.java:109)
    [java] at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:112)
    [java] at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:90)
    [java]


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 26/Sep/05 11:00 PM
A question about the jdoPreClear test. The InstanceCallbackClass has a flag "performPreClearTests". This is "false" during setUp, but during the test *and* during tearDown() it is true. Why is it true for tearDown() operations ? Surely the test/java/org/apache/jdo/tck/api/instancecallbacks/CallingJdoPreclear.java should reset it to false when the test is run so then tearDown performs a normal operation ?

Erik Bengtson added a comment - 27/Sep/05 11:59 PM
> Hi Erik,
>
> On Jul 17, 2005, at 2:15 AM, erik@jpox.org wrote:
>
> > TCK: org.apache.jdo.tck.api.instancecallbacks.CallingJdoPreclear -
> > JIRA #70
> >
> > During commit jdoPreClear is called in p-deleted instances.
> > jdoPreClear is not enhanced, and access to persistent fields is not
> > allowed on p-deleted instances, but the TCK does. Should jdoPreClear
> > be called on p-deleted instances?
>
> Yes. The idea is that jdoPreClear cannot affect the persistent state
> of instances because it's called during afterCompletion. And the
> method is not enhanced so no one will ever know. The job of
> jdoPreClear is to do any cleanup of the instance that might be needed
> before it transitions to transient.
>
> Access to persistent fields (except for identity fields which can
> always be accessed) of deleted instances is detected by enhanced code
> that ends up calling the StateManager. While in jdoPreDelete, nothing
> that the method does is mediated, which is why it cannot call other
> methods that are enhanced!
>
> Craig

The jdoPreClear is trying to read a field in a pc-deleted instance. It's happening during tearDown as Andy said.

Craig Russell added a comment - 28/Sep/05 02:52 AM
As Andy reported, the performPreClearTests flag needed to be reset before tearDown to avoid calling jdoPreClear.

The test now runs successfully.

Michael Bouschen added a comment - 23/Apr/06 02:35 AM
Reopened to set the Fix Version/s field to JDO 2 beta.