openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: OpenJPA MySQL tests
Date Thu, 25 Feb 2010 02:03:09 GMT
Hi Donald,

I'll assume that there is work to do to get all the tests passing, and  
won't worry too much about the failures right now.

Thanks for all the info,

Craig

On Feb 24, 2010, at 5:05 PM, Donald Woods wrote:

> The nightly builds we have setup only run 1.3.x against Derby using  
> both
> the IBM and Sun Java SE 5.  There were a lot of junit updates to trunk
> to get MySQL passing (only 2925 of the current 3002 tests are run
> against MySQL on trunk) and I doubt if all those changes were ported
> back to 1.3.x.
>
>
> -Donald
>
>
> On 2/24/10 1:49 PM, Craig L Russell wrote:
>> Hi Donald,
>>
>> Thanks for all that. I'm now trying to run the 1.3.x branch against  
>> MySQL.
>>
>> openjpa.jdbc.JDBC - Using dictionary class
>> "org.apache.openjpa.jdbc.sql.MySQLDictionary" (MySQL
>> 5.1.41-ndb-7.1.2-beta-debug ,MySQL-AB JDBC Driver
>> mysql-connector-java-5.1.12 ( Revision: ${bzr.revision-id} )).
>>
>> I still have several problems, and I'm wondering if there is some
>> configuration that I'm missing or if these tests are known to fail.
>>
>> In the openjpa-persistence-jdbc, the derby tests all pass, but  
>> using the
>> standard mysql profile:
>>
>> clr% mvn test -Ptest-mysql
>> -Dopenjpa.mysql.url=jdbc:mysql://localhost:9306/test
>> -Dopenjpa.mysql.username=root -Dopenjpa.mysql.password=
>>
>> Tests run: 1245, Failures: 8, Errors: 24, Skipped: 0
>>
>> There are a number of things that just sound like bugs in the
>> MySQLDictionary, e.g.
>>
>> org.apache.openjpa.lib.jdbc.ReportingSQLException: You can't specify
>> target table 'TORDER' for update in FROM clause {prepstmnt 3509487
>> UPDATE TORDER SET amount = ?, version = version + 1 WHERE oid IN  
>> (SELECT
>> DISTINCT t0.oid FROM TORDER t0 INNER JOIN TCUSTOMER t1 ON
>> t0.CUSTOMER_COUNTRYCODE = t1.countryCode AND t0.CUSTOMER_ID = t1.id
>> INNER JOIN TCUSTOMER t4 ON t0.CUSTOMER_COUNTRYCODE = t4.countryCode  
>> AND
>> t0.CUSTOMER_ID = t4.id WHERE (t1.name = (SELECT MAX(t3.name) FROM  
>> TORDER
>> t2 INNER JOIN TCUSTOMER t3 ON t2.CUSTOMER_COUNTRYCODE =  
>> t3.countryCode
>> AND t2.CUSTOMER_ID = t3.id WHERE (t4.id = t3.id)))) [params=(long)
>> 1000]} [code=1093, state=HY000]
>>
>> And others that sound like some configuration issue:
>>
>> nonfatal general error>
>> org.apache.openjpa.persistence.PersistenceException: Unknown database
>> 'schema3g' {stmnt 2927524 CREATE TABLE SCHEMA3G.ID_Gen3 (GEN_NAME
>> VARCHAR(255) NOT NULL, GEN_VAL BIGINT, PRIMARY KEY (GEN_NAME)) TYPE =
>> innodb} [code=1049, state=42000]
>>
>> Any ideas? I can either track these down assuming that they are  
>> bugs in
>> the MySQLDictionary but I'd like to know if anyone else has run  
>> into this.
>>
>> Thanks,
>>
>> Craig
>>
>> Failed tests:
>>   
>> testChangeListOrder 
>> (org.apache.openjpa.persistence.kernel.TestProxies2)
>>
>> testPessimisticLocking 
>> (org.apache.openjpa.persistence.kernel.TestPessimisticLocking)
>>
>>
>> testVersionTimestamp 
>> (org.apache.openjpa.persistence.jdbc.annotations.TestVersion)
>>
>>
>> testForeignKey 
>> (org 
>> .apache 
>> .openjpa.persistence.relations.TestCascadingOneManyWithForeignKey)
>>
>>
>> testConsistentDatastoreTransactionWithRollback 
>> (org.apache.openjpa.persistence.kernel.TestCheckConsistency)
>>
>>
>> testConsistentOptimisticTransactionWithRollback 
>> (org.apache.openjpa.persistence.kernel.TestCheckConsistency)
>>
>>
>> testAggregateExpressionInHavingExpression 
>> (org 
>> .apache.openjpa.persistence.jdbc.query.TestMultipleEntityProjection)
>>
>>   
>> testUpdateWithNull(org.apache.openjpa.jdbc.meta.strats.TestReaderLob)
>>
>> Tests in error:
>>
>> testGeneratedAUTO 
>> (org 
>> .apache.openjpa.persistence.generationtype.TestMultipleSchemaNames)
>>
>>
>> testGeneratedTABLE 
>> (org 
>> .apache.openjpa.persistence.generationtype.TestMultipleSchemaNames)
>>
>>
>> testGeneratedIDENTITY 
>> (org 
>> .apache.openjpa.persistence.generationtype.TestMultipleSchemaNames)
>>
>>
>> testNullOnOptionalFieldIsAllowed 
>> (org.apache.openjpa.persistence.nullity.TestBasicFieldNullity)
>>
>>
>> testNotNullOnOptionalFieldIsAllowed 
>> (org.apache.openjpa.persistence.nullity.TestBasicFieldNullity)
>>
>>
>> testNotNullOnNonOptionalFieldIsAllowed 
>> (org.apache.openjpa.persistence.nullity.TestBasicFieldNullity)
>>
>>
>> testNullOnNullableColumnAllowed 
>> (org.apache.openjpa.persistence.nullity.TestBasicFieldNullity)
>>
>>
>> testNotNullOnNullableColumnIsAllowed 
>> (org.apache.openjpa.persistence.nullity.TestBasicFieldNullity)
>>
>>
>> testNotNullOnNonNullableColumnIsAllowed 
>> (org.apache.openjpa.persistence.nullity.TestBasicFieldNullity)
>>
>>
>> testNullOnOptionalBlobFieldIsAllowed 
>> (org.apache.openjpa.persistence.nullity.TestBasicFieldNullity)
>>
>>
>> testNullOnNullableBlobColumnAllowed 
>> (org.apache.openjpa.persistence.nullity.TestBasicFieldNullity)
>>
>>  testX(org.apache.openjpa.persistence.nullity.TestBasicFieldNullity)
>>
>> testLoadQueries 
>> (org 
>> .apache 
>> .openjpa.persistence.jdbc.query.cache.TestQueryTimestampEviction)
>>
>>
>> testEviction 
>> (org 
>> .apache 
>> .openjpa.persistence.jdbc.query.cache.TestQueryTimestampEviction)
>>
>>
>> testSimpleCompoundIdTestEntity 
>> (org.apache.openjpa.persistence.identity.TestCompundIdWithNull)
>>
>>
>> testComplexCompoundIdTestEntity 
>> (org.apache.openjpa.persistence.identity.TestCompundIdWithNull)
>>
>>
>> testConsistentOptimisticTransaction 
>> (org.apache.openjpa.persistence.kernel.TestCheckConsistency)
>>
>>
>> testQuery 
>> (org 
>> .apache 
>> .openjpa 
>> .persistence.relations.TestRelationFieldAsPrimaryKeyAndForeignKey)
>>
>>
>> testUnboundEntities 
>> (org 
>> .apache 
>> .openjpa 
>> .persistence.relations.TestRelationFieldAsPrimaryKeyAndForeignKey)
>>
>>
>> testDeletes 
>> (org 
>> .apache 
>> .openjpa 
>> .persistence.relations.TestRelationFieldAsPrimaryKeyAndForeignKey)
>>
>>
>> testEscapedQuery 
>> (org.apache.openjpa.persistence.query.TestQueryEscapeCharacters)
>>
>>   
>> testQueryRange 
>> (org.apache.openjpa.persistence.jdbc.meta.TestRangeQuery)
>>  testSubquery2(org.apache.openjpa.persistence.query.TestSubquery)
>>  testSubquery(org.apache.openjpa.persistence.query.TestSubquery)
>>
>>
>> On Feb 23, 2010, at 6:37 AM, Donald Woods wrote:
>>
>>> For 1.2.x and trunk runs, we also include the following cmdline  
>>> settings
>>> for the nightly builds -
>>>  -Ddbcp.maxIdle=0 -Ddbcp.minIdle=0
>>>
>>> For 1.2.x and Sun Java SE 5, we also set -
>>>  MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m"
>>>
>>> For trunk and Sun Java SE 6, we also set -
>>>  MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=512m"
>>>
>>>
>>> Hope that helps,
>>> Donald
>>>
>>>
>>> On 2/22/10 11:06 PM, Craig L Russell wrote:
>>>> Hi,
>>>>
>>>> While I sort out the issue of using the MySQL-AB driver, I have  
>>>> some
>>>> other problems that might not be related to the driver.
>>>>
>>>> When I run the tests in tags/1.2.2/openjpa-persistence-jdbc using
>>>>
>>>> mvn test -Ptest-mysql
>>>> -Dopenjpa.mysql.url=jdbc:mysql://localhost:9306/test
>>>> -Dopenjpa.mysql.username=root -Dopenjpa.mysql.password=
>>>>
>>>> Here is the summary:
>>>> Tests run: 1031, Failures: 14, Errors: 396, Skipped: 0
>>>>
>>>> By far, the largest number of failures are due to this:
>>>>
>>>> Caused by:
>>>> com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException:  
>>>> Data
>>>> source rejected establishment of connection,  message from  
>>>> server: "Too
>>>> many connections"
>>>>   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:980)
>>>>   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
>>>>   at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1095)
>>>>   at
>>>> com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2031)
>>>>   at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:718)
>>>>   at  
>>>> com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:298)
>>>>   at
>>>> com 
>>>> .mysql 
>>>> .jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282)
>>>>
>>>>   at
>>>> org 
>>>> .apache 
>>>> .commons 
>>>> .dbcp 
>>>> .DriverConnectionFactory 
>>>> .createConnection(DriverConnectionFactory.java:37)
>>>>
>>>>
>>>>   at
>>>> org 
>>>> .apache 
>>>> .commons 
>>>> .dbcp 
>>>> .PoolableConnectionFactory 
>>>> .makeObject(PoolableConnectionFactory.java:290)
>>>>
>>>>
>>>>   at
>>>> org 
>>>> .apache 
>>>> .commons 
>>>> .dbcp 
>>>> .BasicDataSource.validateConnectionFactory(BasicDataSource.java: 
>>>> 877)
>>>>
>>>>
>>>>   at
>>>> org 
>>>> .apache 
>>>> .commons 
>>>> .dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851)
>>>>
>>>>
>>>>
>>>> This is during configuration of the connection pool. Is there some
>>>> recommended way to set up the MySQL server or the dbcp pool to  
>>>> work?
>>>>
>>>> I'm also getting lots of somewhat random errors. [1] Has anyone  
>>>> run the
>>>> MySQL suite recently?
>>>>
>>>> Any insight into what I might be doing wrong here will help.
>>>>
>>>> Thanks,
>>>>
>>>> Craig
>>>>
>>>> [1]
>>>> testChangeListOrder 
>>>> (org.apache.openjpa.persistence.kernel.TestProxies2)
>>>> Time elapsed: 4.961 sec  <<< FAILURE!
>>>> junit.framework.AssertionFailedError: expected:<val1> but  
>>>> was:<val2>
>>>>
>>>> ...
>>>> testEmptyBrokerSerialization 
>>>> (org 
>>>> .apache 
>>>> .openjpa 
>>>> .kernel.TestUnenhancedPropertyAccessInstanceBrokerSerialization)
>>>>
>>>> Time elapsed: 0.107 sec  <<< ERROR!
>>>> java.lang.UnsupportedOperationException
>>>>   at
>>>> org 
>>>> .apache 
>>>> .openjpa 
>>>> .enhance 
>>>> .ReflectingPersistenceCapable 
>>>> .pcSetDetachedState(ReflectingPersistenceCapable.java:323)
>>>>
>>>>
>>>>   at
>>>> org 
>>>> .apache 
>>>> .openjpa.kernel.DetachManager.detachInternal(DetachManager.java: 
>>>> 476)
>>>>
>>>>
>>>>   at
>>>> org 
>>>> .apache.openjpa.kernel.DetachManager.detachAll(DetachManager.java: 
>>>> 325)
>>>>
>>>> ...
>>>> Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Data
>>>> truncation: Out of range value for column 'id' at row 1 {prepstmnt
>>>> 7779720 INSERT INTO SQLBigDecimalIdEntity (id, data) VALUES (?, ?)
>>>> [params=(BigDecimal) 1266874412000, (int) 1]} [code=0, state=01004]
>>>>   at
>>>> org 
>>>> .apache 
>>>> .openjpa 
>>>> .lib 
>>>> .jdbc 
>>>> .LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java: 
>>>> 192)
>>>>
>>>>
>>>>   at
>>>> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access 
>>>> $700(LoggingConnectionDecorator.java:57)
>>>>
>>>>
>>>>   at
>>>> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator 
>>>> $LoggingConnection 
>>>> $ 
>>>> LoggingPreparedStatement 
>>>> .executeUpdate(LoggingConnectionDecorator.java:866)
>>>>
>>>>
>>>>   at
>>>> org 
>>>> .apache 
>>>> .openjpa 
>>>> .lib 
>>>> .jdbc 
>>>> .DelegatingPreparedStatement 
>>>> .executeUpdate(DelegatingPreparedStatement.java:269)
>>>>
>>>>
>>>>   at
>>>> org.apache.openjpa.jdbc.kernel.JDBCStoreManager 
>>>> $CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1590)
>>>>
>>>>
>>>>   at
>>>> org 
>>>> .apache 
>>>> .openjpa 
>>>> .jdbc 
>>>> .kernel 
>>>> .PreparedStatementManagerImpl 
>>>> .executeUpdate(PreparedStatementManagerImpl.java:151)
>>>>
>>>>
>>>>   at
>>>> org 
>>>> .apache 
>>>> .openjpa 
>>>> .jdbc 
>>>> .kernel 
>>>> .PreparedStatementManagerImpl 
>>>> .flushAndUpdate(PreparedStatementManagerImpl.java:120)
>>>>
>>>>
>>>>
>>>> testComplexCompoundIdTestEntity 
>>>> (org.apache.openjpa.persistence.identity.TestCompundIdWithNull)
>>>>
>>>> Time elapsed: 0.885 sec  <<< ERROR!
>>>> org.apache.openjpa.lib.jdbc.ReportingSQLException: You have an  
>>>> error in
>>>> your SQL syntax; check the manual that corresponds to your MySQL  
>>>> server
>>>> version for the right syntax to use near 'CONSTRAINT test_type_pk
>>>> PRIMARY KEY, code VARCHAR(16))' at line 1 {stmnt 4807894 CREATE  
>>>> TABLE
>>>> test_type(id NUMERIC CONSTRAINT test_type_pk PRIMARY KEY, code
>>>> VARCHAR(16))} [code=1064, state=42000]
>>>>
>>>> Running
>>>> org 
>>>> .apache 
>>>> .openjpa 
>>>> .persistence.jdbc.unique.TestUniqueConstraintWithXMLDescriptor
>>>>
>>>>
>>>> 0  test-unique-constraint  INFO   [main] openjpa.Runtime - Starting
>>>> OpenJPA 1.2.2
>>>> 57  test-unique-constraint  INFO   [main] openjpa.jdbc.JDBC - Using
>>>> dictionary class  
>>>> "org.apache.openjpa.jdbc.sql.MySQLDictionary" (MySQL
>>>> 5.1.41-ndb-7.1.2-beta-debug ,MySQL-AB JDBC Driver
>>>> mysql-connector-java-5.1.6 ( Revision: ${svn.Revision} )).
>>>> 1:CREATE TABLE UNIQUE_A_XML (aid INTEGER NOT NULL, a1x INTEGER  
>>>> NOT NULL,
>>>> a2x INTEGER NOT NULL, a3x INTEGER NOT NULL, a4x INTEGER NOT NULL,  
>>>> a5x
>>>> INTEGER, a6x INTEGER, PRIMARY KEY (aid), UNIQUE UNQ_a1xa2x (a1x,  
>>>> a2x),
>>>> UNIQUE UNQ_a3xa4x (a3x, a4x)) TYPE = innodb
>>>> 2:CREATE TABLE UNIQUE_B_XML (bid INTEGER NOT NULL, b1x INTEGER  
>>>> NOT NULL,
>>>> b2x INTEGER NOT NULL, PRIMARY KEY (bid), UNIQUE UNQ_b1xb2x (b1x,  
>>>> b2x))
>>>> TYPE = innodb
>>>> 3:CREATE TABLE UNIQUE_GENERATOR_XML (GEN1_XML VARCHAR(255) NOT  
>>>> NULL,
>>>> GEN2_XML BIGINT NOT NULL, PRIMARY KEY (GEN1_XML), UNIQUE  
>>>> U_NQ_GXML_UNQ
>>>> (GEN1_XML, GEN2_XML)) TYPE = innodb
>>>> 4:CREATE TABLE UNIQUE_JOINTABLE_XML (FK_A_XML INTEGER NOT NULL,  
>>>> FK_B_XML
>>>> INTEGER NOT NULL, UNIQUE UNQ_FK_A_XMLFK_B_XML (FK_A_XML,  
>>>> FK_B_XML)) TYPE
>>>> = innodb
>>>> 5:CREATE TABLE UNIQUE_SECONDARY_XML (UNIQUEA_AID INTEGER, sa1x  
>>>> SMALLINT
>>>> NOT NULL, sa2x SMALLINT, UNIQUE UNQ_sa1x (sa1x)) TYPE = innodb
>>>> 6:CREATE INDEX I_NQ_JXML_ELEMENT ON UNIQUE_JOINTABLE_XML (FK_B_XML)
>>>> 7:CREATE INDEX I_NQ_JXML_FK_A_XML ON UNIQUE_JOINTABLE_XML  
>>>> (FK_A_XML)
>>>> 8:CREATE INDEX I_NQ_SXML_UNIQUEA_AID ON UNIQUE_SECONDARY_XML
>>>> (UNIQUEA_AID)
>>>> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed:  
>>>> 5.049
>>>> sec <<< FAILURE!
>>>> testMapping 
>>>> (org 
>>>> .apache 
>>>> .openjpa 
>>>> .persistence.jdbc.unique.TestUniqueConstraintWithXMLDescriptor)
>>>>
>>>> Time elapsed: 5.046 sec  <<< FAILURE!
>>>> junit.framework.AssertionFailedError: None of the 8 SQL contains  
>>>> all
>>>> keys [CREATE TABLE UNIQUE_A_XML, UNIQUE \w*\(a1x, a2x\), UNIQUE
>>>> \w*\(a3x, a4x\)]
>>>>   at junit.framework.Assert.fail(Assert.java:47)
>>>>   at
>>>> org 
>>>> .apache 
>>>> .openjpa 
>>>> .persistence 
>>>> .jdbc 
>>>> .unique 
>>>> .TestUniqueConstraintWithXMLDescriptor 
>>>> .assertSQLFragnments(TestUniqueConstraintWithXMLDescriptor.java:83)
>>>>
>>>>
>>>>   at
>>>> org 
>>>> .apache 
>>>> .openjpa 
>>>> .persistence 
>>>> .jdbc 
>>>> .unique 
>>>> .TestUniqueConstraintWithXMLDescriptor 
>>>> .testMapping(TestUniqueConstraintWithXMLDescriptor.java:62)
>>>>
>>>>
>>>> ...
>>>> testForeignKey 
>>>> (org 
>>>> .apache 
>>>> .openjpa.persistence.relations.TestCascadingOneManyWithForeignKey)
>>>>
>>>> Time elapsed: 0.506 sec  <<< FAILURE!
>>>> junit.framework.AssertionFailedError: Commit should have failed  
>>>> due to
>>>> FK constraint violation.
>>>>   at junit.framework.Assert.fail(Assert.java:47)
>>>>   at
>>>> org 
>>>> .apache 
>>>> .openjpa 
>>>> .persistence 
>>>> .relations 
>>>> .TestCascadingOneManyWithForeignKey 
>>>> .testForeignKey(TestCascadingOneManyWithForeignKey.java:144)
>>>>
>>>>
>>>> ...
>>>> Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Field
>>>> 'int_not_null_no_default_null_value_default' doesn't have a default
>>>> value {prepstmnt 9810063 INSERT INTO NullValues (id, notNullable,
>>>> notNullableBlob, notOptional, notOptionalBlob, nullable,  
>>>> nullableBlob,
>>>> optional, optionalBlob, version) VALUES  
>>>> (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
>>>> [params=(long) 1, (int) 42, (InputStream)
>>>> java.io.ByteArrayInputStream@9cc8fe, (int) 42, (InputStream)
>>>> java.io.ByteArrayInputStream@daebbf, (int) 42, (InputStream)
>>>> java.io.ByteArrayInputStream@e22e4b, (int) 42, (InputStream)
>>>> java.io.ByteArrayInputStream@e24abe, (int) 1]} [code=1364,  
>>>> state=HY000]
>>>>   at
>>>> org 
>>>> .apache 
>>>> .openjpa 
>>>> .lib 
>>>> .jdbc 
>>>> .LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java: 
>>>> 192)
>>>>
>>>>
>>>>
>>>>
>>>> Craig L Russell
>>>> Architect, Sun Java Enterprise System http://db.apache.org/jdo
>>>> 408 276-5638 mailto:Craig.Russell@sun.com
>>>> P.S. A good JDO? O, Gasp!
>>>>
>>>>
>>
>> Craig L Russell
>> Architect, Sun Java Enterprise System http://db.apache.org/jdo
>> 408 276-5638 mailto:Craig.Russell@sun.com
>> P.S. A good JDO? O, Gasp!
>>
>>

Craig L Russell
Architect, Sun Java Enterprise System http://db.apache.org/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message