Weird bug related to batching

From: Holger Hoffstätte (holge..izards.de)
Date: Sat Mar 08 2003 - 16:43:31 EST

  • Next message: Andriy Shapochka: "Re: Dead code killing"

    After a long time I just tried again to run Dirk's original DbUnit based
    EventManager test, and behold! it crashed and burned with all sorts of
    strange errors that were defnitely not there before. Mostly
    ClassCastExceptions related to the Db/ObjAttribute type duality with Date,
    so either it's something with batching and/or something with the recent
    changes to Date/Time/Timestamp. Here's a sample (interesting stuff at the
    bottom):

    org.objectstyle.cayenne.CayenneRuntimeException: Raising from
    underlyingQueryEngine exception.
            at
    org.objectstyle.cayenne.access.util.ContextCommitObserver.nextGlobalException(ContextCommitObserver.java:186)
            at
    org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:355)
            at
    org.objectstyle.cayenne.access.ContextCommit.commit(ContextCommit.java:187)
            at
    org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:706)
            at dbunit.DataContextTests.testDataContext(DataContextTests.java:73)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at junit.framework.TestCase.runTest(TestCase.java:154)
            at junit.framework.TestCase.runBare(TestCase.java:127)
            at junit.framework.TestResult$1.protect(TestResult.java:106)
            at junit.framework.TestResult.runProtected(TestResult.java:124)
            at junit.framework.TestResult.run(TestResult.java:109)
            at junit.framework.TestCase.run(TestCase.java:118)
            at junit.framework.TestSuite.runTest(TestSuite.java:208)
            at junit.framework.TestSuite.run(TestSuite.java:203)
            at
    org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:386)
            at
    org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:270)
            at
    org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:161)
    Caused by: org.objectstyle.cayenne.CayenneRuntimeException: Raising from
    query exception.
            at
    org.objectstyle.cayenne.access.util.ContextCommitObserver.nextQueryException(ContextCommitObserver.java:181)
            at
    org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:311)
            ... 18 more
    Caused by: org.objectstyle.cayenne.CayenneException:
    java.lang.ClassCastException
            at
    org.objectstyle.cayenne.dba.oracle.OracleBatchInterpreter.execute(OracleBatchInterpreter.java:130)
            at
    org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:273)
            ... 18 more
    Caused by: java.lang.ClassCastException
            at
    oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2832)
            at
    org.objectstyle.cayenne.access.types.AbstractType.setJdbcObject(AbstractType.java:81)
            at
    org.objectstyle.cayenne.dba.oracle.OracleBatchInterpreter.execute(OracleBatchInterpreter.java:119)
            ... 19 more

    I get similar errors with PostgreSQL, but they vary in detail and the
    exact location, although it's always related to Artists' birthDate type
    conversion. I dug a little deeper and am none the wiser now, especially
    since it works against MySQL (except for the rollback test, which is a
    MySQL problem).

    Could someone who understand more about the batching operations look at
    this? It's easily reproducable, just check out sandbox/holger (as
    top-level project in eclipse), fix connection settings in dbunit.conf.*
    and run dbunit.DataContextTests. The single row in
    tests/DBUnitTestData.xml is inserted during the setUp() phase.
    Maybe there's something wrong with the map? I copied it straight from the
    main tree, and DataContext based fetching works just fine with it
    (simple.SimpleTest runs as is).

    Holger



    This archive was generated by hypermail 2.0.0 : Sat Mar 08 2003 - 16:47:05 EST