Bug #50925 | OpenJPA/ClusterJ Table dictionary lookups fails for non 'test' named DBs. | ||
---|---|---|---|
Submitted: | 4 Feb 2010 18:04 | Modified: | 12 Mar 2010 14:04 |
Reporter: | Alexander Yu | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Cluster: Cluster/J | Severity: | S3 (Non-critical) |
Version: | 7.1.1 | OS: | Any |
Assigned to: | Assigned Account | CPU Architecture: | Any |
Tags: | Cluster/J, MySQL Cluster, openjpa |
[4 Feb 2010 18:04]
Alexander Yu
[5 Feb 2010 14:00]
Bernd Ocklin
Hi Alex, have you tried to set <property name="openjpa.ndb.database" value="tt"/> in your persistence.xml? There are some difficulties with glassfish picking up changes if JNDI is not restarted properly after deployment.
[9 Feb 2010 15:06]
Alexander Yu
Hi Bernd, I'm getting inconsistent results. The no such table error pops up now and then. But it does not seem to be related to the test database name anymore. My persistence.xml below for your reference. <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"> <persistence-unit name="OpenJPAWorldPU" transaction-type="JTA"> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider> <jta-data-source>mysqlworld</jta-data-source> <class>ndb.jpa.world.City</class> <class>ndb.jpa.world.Country</class> <class>ndb.jpa.world.Countrylanguage</class> <properties> <property name="openjpa.ndb.database" value="world"/> <property name="openjpa.BrokerFactory" value="com.mysql.clusterj.openjpa.NdbOpenJPABrokerFactory"/> <property name="openjpa.ndb.connectString" value="localhost:1186"/> <property name="openjpa.ndb.connectVerbose" value="1"/> <property name="openjpa.ConnectionRetainMode" value="transaction"/> <property name="openjpa.DataCache" value="false"/> </properties> </persistence-unit> </persistence>
[12 Feb 2010 14:03]
Craig Russell
Have you set the "use lower case" flag in the MySQL Server? This sounds like a case issue. ClusterJ will take the name you specify and use it directly and then if not found, will lower-case the name. http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html
[13 Mar 2010 0:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[16 Mar 2010 21:03]
Craig Russell
I've added a test in the clusterj suite to make sure that databases other than test can be used. I still need a test for the clusterjpa path... clr% bzr commit -m "Add test for database property in connection properties" clusterj-test clusterj-tie/src/test/java/testsuite/clusterj/tie/FindByPrimaryKey2Test.java Committing to: /Users/clr/ndb/root/clusterj-working/ added clusterj-test/src/main/java/testsuite/clusterj/FindByPrimaryKey2Test.java added clusterj-test/src/main/java/testsuite/clusterj/model/Employee2.java modified clusterj-test/src/main/resources/schema.sql added clusterj-tie/src/test/java/testsuite/clusterj/tie/FindByPrimaryKey2Test.java Committed revision 228. [CraigRussell:~/ndb/root/clusterj-working] clr% bzr push Using saved push location: bzr+ssh://crussell@bk-internal.mysql.com/bzrroot/clusterj/ Pushed up to revision 228. [CraigRussell:~/ndb/root/clusterj-working] clr% pushd ../clusterj ; bzr pull ; popd~/ndb/root/clusterj ~/ndb/root/clusterj-working Using saved parent location: bzr+ssh://crussell@bk-internal.mysql.com/bzrroot/clusterj/ +N clusterj-test/src/main/java/testsuite/clusterj/FindByPrimaryKey2Test.java +N clusterj-test/src/main/java/testsuite/clusterj/model/Employee2.java +N clusterj-tie/src/test/java/testsuite/clusterj/tie/FindByPrimaryKey2Test.java M clusterj-test/src/main/resources/schema.sql All changes applied successfully. Now on revision 228. ~/ndb/root/clusterj-working