Bug 301184 - Several wdf tests failed on Oracle database
Summary: Several wdf tests failed on Oracle database
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
Depends on:
Blocks:
 
Reported: 2010-01-28 15:05 EST by Kevin Yuan CLA
Modified: 2022-06-09 10:35 EDT (History)
5 users (show)

See Also:


Attachments
proposed patch (4.75 KB, patch)
2010-02-05 04:17 EST, Adrian Goerler CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Yuan CLA 2010-01-28 15:05:27 EST
EclipseLink: 2.1.0.v20100128-r6434
JDK: SUN jdk_1.6.0_16
DB: Oracle 11.1.0.7

Try to run wdf test on javaSE under \trunk\jpa\eclipselink.jpa.wdf.test, all 752 tests passed on MySQL 5.1.39, but there are 13 tests failed on Oracle 11.1.0.7 DB, and all failures came from "org.eclipse.persistence.testing.tests.wdf.jpa1.query". The following are some stack trace:

Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected - got BLOB Error Code: 932 Call: SELECT ID, W_BYTE, PCA_CLOB, ENUM_STRING, P_DOUBLE, PBA_BLOB, W_LONG, PCA_VARCHAR, ENUM_ORDINAL, SQL_TIME, WBA_BLOB, P_BOOLEAN, UTIL_DATE, BIG_DECIMAL, P_LONG, VERSION, W_INTEGER, P_INT, W_DOUBLE, WCA_VARCHAR, UTIL_CALENDAR, P_SHORT, SERIALIZABLE, P_FLOAT, SQL_TIMESTAMP, W_BOOLEAN, WBA_LONGVARBINARY, PBA_LONGVARBINARY, BIG_INTEGER, WCA_CLOB, STRING_VC, SQL_DATE, PBA_BINARY, P_BYTE, W_SMALLINT, W_CHARACTER, P_CHAR, W_FLOAT, WBA_BINARY, STRING_CLOB FROM TMP_BASIC_TYPES_FA WHERE (PBA_BINARY IN (?, ?)) bind => [[B@4cbcaf, [B@1f7c3e3] Query: ReadAllQuery(referenceClass=BasicTypesFieldAccess sql="SELECT ID, W_BYTE, PCA_CLOB, ENUM_STRING, P_DOUBLE, PBA_BLOB, W_LONG, PCA_VARCHAR, ENUM_ORDINAL, SQL_TIME, WBA_BLOB, P_BOOLEAN, UTIL_DATE, BIG_DECIMAL, P_LONG, VERSION, W_INTEGER, P_INT, W_DOUBLE, WCA_VARCHAR, UTIL_CALENDAR, P_SHORT, SERIALIZABLE, P_FLOAT, SQL_TIMESTAMP, W_BOOLEAN, WBA_LONGVARBINARY, PBA_LONGVARBINARY, BIG_INTEGER, WCA_CLOB, STRING_VC, SQL_DATE, PBA_BINARY, P_BYTE, W_SMALLINT, W_CHARACTER, P_CHAR, W_FLOAT, WBA_BINARY, STRING_CLOB FROM TMP_BASIC_TYPES_FA WHERE (PBA_BINARY IN (?, ?))")

Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.0.qualifier): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected - got BLOB

Error Code: 932
Call: SELECT ID, W_BYTE, PCA_CLOB, ENUM_STRING, P_DOUBLE, PBA_BLOB, W_LONG, PCA_VARCHAR, ENUM_ORDINAL, SQL_TIME, WBA_BLOB, P_BOOLEAN, UTIL_DATE, BIG_DECIMAL, P_LONG, VERSION, W_INTEGER, P_INT, W_DOUBLE, WCA_VARCHAR, UTIL_CALENDAR, P_SHORT, SERIALIZABLE, P_FLOAT, SQL_TIMESTAMP, W_BOOLEAN, WBA_LONGVARBINARY, PBA_LONGVARBINARY, BIG_INTEGER, WCA_CLOB, STRING_VC, SQL_DATE, PBA_BINARY, P_BYTE, W_SMALLINT, W_CHARACTER, P_CHAR, W_FLOAT, WBA_BINARY, STRING_CLOB FROM TMP_BASIC_TYPES_FA WHERE (PBA_BINARY IN (?, ?))
bind => [[B@4cbcaf, [B@1f7c3e3]
Query: ReadAllQuery(referenceClass=BasicTypesFieldAccess sql="SELECT ID, W_BYTE, PCA_CLOB, ENUM_STRING, P_DOUBLE, PBA_BLOB, W_LONG, PCA_VARCHAR, ENUM_ORDINAL, SQL_TIME, WBA_BLOB, P_BOOLEAN, UTIL_DATE, BIG_DECIMAL, P_LONG, VERSION, W_INTEGER, P_INT, W_DOUBLE, WCA_VARCHAR, UTIL_CALENDAR, P_SHORT, SERIALIZABLE, P_FLOAT, SQL_TIMESTAMP, W_BOOLEAN, WBA_LONGVARBINARY, PBA_LONGVARBINARY, BIG_INTEGER, WCA_CLOB, STRING_VC, SQL_DATE, PBA_BINARY, P_BYTE, W_SMALLINT, W_CHARACTER, P_CHAR, W_FLOAT, WBA_BINARY, STRING_CLOB FROM TMP_BASIC_TYPES_FA WHERE (PBA_BINARY IN (?, ?))")
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:333)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:687)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:530)
at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:529)
at org.eclipse.persistence.internal.sessions.IsolatedClientSession.executeCall(IsolatedClientSession.java:133)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:205)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:191)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:262)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:618)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2538)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2497)
at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:457)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:988)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:732)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:948)
at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:434)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1012)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2871)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1225)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1207)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1181)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:458)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultList(EJBQueryImpl.java:686)
at org.eclipse.persistence.testing.tests.wdf.jpa1.query.QueryTest.assertValidQueryExecutionWithArgs(QueryTest.java:228)
at org.eclipse.persistence.testing.tests.wdf.jpa1.query.TestConditionalExpressions.testInBinary(TestConditionalExpressions.java:614)
at org.eclipse.persistence.testing.framework.wdf.SkipBugzillaTestRunner.runChild(SkipBugzillaTestRunner.java:92)
at org.eclipse.persistence.testing.framework.wdf.SkipBugzillaTestRunner.runChild(SkipBugzillaTestRunner.java:32)
Caused by: java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected - got BLOB

at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3431)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:892)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:602)

Others failures are similar to this.
Comment 1 Adrian Goerler CLA 2010-01-29 04:14:07 EST
This is strange. The test below is known to fail on Oracle and is annotated to be skipped. Maybe ther is an issue with the skip mechanism.

On my machine, it works with this setting:

db.platform=org.eclipse.persistence.platform.database.OraclePlatform

Maybe, you are using a different platform?
Comment 2 Kevin Yuan CLA 2010-01-29 12:00:32 EST
The following are my DB info in test.properties:

jdbc.driver.jar=../../../extension.oracle.lib.external/ojdbc6_11.jar
db.driver=oracle.jdbc.OracleDriver
db.url=jdbc:oracle:thin:@localhost:1521:ECLIPSELINK
db.user=eluser
db.pwd=password
db.platform=org.eclipse.persistence.platform.database.oracle.Oracle11Platform

The following are the testing procedure:
- Execute "ant build" under \trunk\jpa\eclipselink.jpa.wdf.test dir;
- Execute "ant test" under \trunk\jpa\eclipselink.jpa.wdf.test.

I have verified that I got the same results (13 failures) after I change the db.platform from "org.eclipse.persistence.platform.database.oracle.Oracle11Platform" to "org.eclipse.persistence.platform.database.OraclePlatform".
Comment 3 Adrian Goerler CLA 2010-01-29 12:37:49 EST
I think the skipping mechanism takes the database platform from a test.properties file which is either in the folder you run "ant test" from or on the classpath. The loadProperties method in org.eclipse.persistence.testing.framework.wdf.SkipBugzillaTestRunner loads the value of the "db.platform" property.

In my case the test.properties file is in the local folder. Could you please try this?

Where is your test.properties file?
Comment 4 Adrian Goerler CLA 2010-01-29 12:39:25 EST
In any case we should make sure that the SkipBugzillaTestRunner takes the properties from the same location as the "ant test" target does.
Comment 5 Kevin Yuan CLA 2010-01-29 14:14:16 EST
Actually I put the test.properties under home directory, and the DB did log in using ${user.home}/test.properties when I check the log file. But loadProperties method in org.eclipse.persistence.testing.framework.wdf.SkipBugzillaTestRunner loads the value of the "db.platform" from test.property under current directory (/trunk/jpa/eclipselink.jpa.wdf.test).
Thanks for reminding me to relocate test.properties to current dir, and I have verified 12 of 13 failures didn't occur anymore (total 14 tests are skipped on Oracle DB).
Currently only one test (org.eclipse.persistence.testing.tests.wdf.jpa1.query.TestSimpleQuery.testMaxResult) failed on Oracle DB, the following are stack trace:

wrong row count: 0

junit.framework.AssertionFailedError: wrong row count: 0
at org.eclipse.persistence.testing.framework.wdf.SkipBugzillaTestRunner.runChild(SkipBugzillaTestRunner.java:92)
at org.eclipse.persistence.testing.framework.wdf.SkipBugzillaTestRunner.runChild(SkipBugzillaTestRunner.java:32)
at org.eclipse.persistence.testing.framework.wdf.AbstractBaseTest.verify(AbstractBaseTest.java:191)
at org.eclipse.persistence.testing.tests.wdf.jpa1.query.TestSimpleQuery.verifyRowCount(TestSimpleQuery.java:568)
at org.eclipse.persistence.testing.tests.wdf.jpa1.query.TestSimpleQuery.testMaxResult(TestSimpleQuery.java:588)
Comment 6 Adrian Goerler CLA 2010-02-01 02:38:26 EST
The issue with TestSimpleQuery.testMaxResults is followed up by bug 301274.
Comment 7 Adrian Goerler CLA 2010-02-05 04:17:14 EST
Created attachment 158281 [details]
proposed patch

The build.xml has a sophisticated overriding mechanism for the properties. It sets the database-platform-property as a system property if specified in a build.properties or test.propeties file.

With the patch, the database-platform-property will be picked up from the system property if set.
Comment 8 Adrian Goerler CLA 2010-02-08 05:36:56 EST
reviewed by Kevin
checked in at rev # 6529
Comment 9 Eclipse Webmaster CLA 2022-06-09 10:35:07 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink