You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by "Michelle Caisse (JIRA)" <ji...@apache.org> on 2008/02/08 23:24:07 UTC
[jira] Created: (JDO-576) Create new tests for getting a pmf using
jdoconfig.xml
Create new tests for getting a pmf using jdoconfig.xml
------------------------------------------------------
Key: JDO-576
URL: https://issues.apache.org/jira/browse/JDO-576
Project: JDO
Issue Type: Test
Components: tck2, tck2-legacy
Reporter: Michelle Caisse
Assignee: Michelle Caisse
Fix For: JDO 2 maintenance release 1
New tests are needed to test getting a persistence manager factory with JDOHelper.getPersistenceManagerFactory() and JDOHelper.getPersistenceManagerFactory(String name);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JDO-576) Create new tests for getting a pmf
using jdoconfig.xml
Posted by "Michelle Caisse (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JDO-576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569423#action_12569423 ]
Michelle Caisse commented on JDO-576:
-------------------------------------
We had set up these tests to run from runonce.conf (only on application identity with the RI) so that we wouldn't have to do the work of getting javax.jdo.mapping.Schema set properly for the two identity types. However, that is not going to work in the long run, so the latest check-in uses overrides to set the schema. Unfortunately, the tests that use overrides fail. The override is not overriding the bogus value now in jdoconfig.xml.
> Create new tests for getting a pmf using jdoconfig.xml
> ------------------------------------------------------
>
> Key: JDO-576
> URL: https://issues.apache.org/jira/browse/JDO-576
> Project: JDO
> Issue Type: Test
> Components: tck2, tck2-legacy
> Reporter: Michelle Caisse
> Assignee: Michelle Caisse
> Fix For: JDO 2 maintenance release 1
>
>
> New tests are needed to test getting a persistence manager factory with JDOHelper.getPersistenceManagerFactory() and JDOHelper.getPersistenceManagerFactory(String name);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JDO-576) Create new tests for getting a pmf using
jdoconfig.xml
Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JDO-576?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Craig Russell updated JDO-576:
------------------------------
Attachment: jdo-576.patch
Please review this patch.
With this patch applied, the config.Persistence test succeeds for application identity but fails for datastore identity:
[java] 1) testGetPMFfromEMFNamed(org.apache.jdo.tck.api.persistencemanagerfactory.config.Persistence)javax.jdo.JDODataStoreException: [JPOX-052208] Insert of object "org.apache.jdo.tck.pc.mylib.PCPoint@39f7bc" using statement "INSERT INTO datastoreidentity0.PCPOINT (PCPOINT_ID,Y,X,ID) VALUES (?,?,?,?)" failed : 'PCPOINT_ID' is not a column in table or VTI 'DATASTOREIDENTITY0.PCPOINT'.
[java] at org.jpox.jdo.JPOXJDOHelper.getJDOExceptionForJPOXException(JPOXJDOHelper.java:289)
[java] at org.jpox.jdo.AbstractPersistenceManager.jdoMakePersistent(AbstractPersistenceManager.java:665)
[java] at org.jpox.jdo.AbstractPersistenceManager.makePersistent(AbstractPersistenceManager.java:685)
[java] at org.apache.jdo.tck.api.persistencemanagerfactory.config.Persistence.makePersistent(Persistence.java:108)
[java] at org.apache.jdo.tck.api.persistencemanagerfactory.config.Persistence.runTest(Persistence.java:90)
[java] at org.apache.jdo.tck.api.persistencemanagerfactory.config.Persistence.testGetPMFfromEMFNamed(Persistence.java:67)
[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 org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:259)
[java] at org.apache.jdo.tck.util.BatchTestRunner.doRun(BatchTestRunner.java:108)
[java] at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:148)
[java] at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:123)
[java] NestedThrowablesStackTrace:
[java] ERROR 42X14: 'PCPOINT_ID' is not a column in table or VTI 'DATASTOREIDENTITY0.PCPOINT'.
According to the package.orm, the identity column is named ID, not PCPOINT_ID.
When JPOX uses persistence.xml to find the configuration, does it read package.jdo and package.orm? The configuration info is in package.orm.
> Create new tests for getting a pmf using jdoconfig.xml
> ------------------------------------------------------
>
> Key: JDO-576
> URL: https://issues.apache.org/jira/browse/JDO-576
> Project: JDO
> Issue Type: Test
> Components: tck2, tck2-legacy
> Reporter: Michelle Caisse
> Assignee: Michelle Caisse
> Fix For: JDO 2 maintenance release 1
>
> Attachments: jdo-576.patch
>
>
> New tests are needed to test getting a persistence manager factory with JDOHelper.getPersistenceManagerFactory() and JDOHelper.getPersistenceManagerFactory(String name);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JDO-576) Create new tests for getting a pmf
using jdoconfig.xml
Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JDO-576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574090#action_12574090 ]
Andy Jefferson commented on JDO-576:
------------------------------------
> When JPOX uses persistence.xml to find the configuration, does it read package.jdo and package.orm? The configuration info is in package.orm.
Simple reading of the log would tell the answer to that. Yes it does read the JDO metadata, just as it does for all other situations. The only problem here is that the MetaDataManager was already initialised before it got the info about "javax.jdo.option.Mapping" (since it was specified in the properties for the persistence-unit, as opposed to the normal input properties) and so was looking for package.orm not package-standard.orm. JPOX SVN now passes that too - in fact the TCK says
[java] Total tests run: 1587.
[java] All (109) configurations passed.
> Create new tests for getting a pmf using jdoconfig.xml
> ------------------------------------------------------
>
> Key: JDO-576
> URL: https://issues.apache.org/jira/browse/JDO-576
> Project: JDO
> Issue Type: Test
> Components: tck2, tck2-legacy
> Reporter: Michelle Caisse
> Assignee: Michelle Caisse
> Fix For: JDO 2 maintenance release 1
>
> Attachments: jdo-576.patch
>
>
> New tests are needed to test getting a persistence manager factory with JDOHelper.getPersistenceManagerFactory() and JDOHelper.getPersistenceManagerFactory(String name);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (JDO-576) Create new tests for getting a pmf using
jdoconfig.xml
Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JDO-576?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Craig Russell resolved JDO-576.
-------------------------------
Resolution: Fixed
Tests have been added and checked in, along with updates for JDOHelper.
> Create new tests for getting a pmf using jdoconfig.xml
> ------------------------------------------------------
>
> Key: JDO-576
> URL: https://issues.apache.org/jira/browse/JDO-576
> Project: JDO
> Issue Type: Test
> Components: tck2, tck2-legacy
> Reporter: Michelle Caisse
> Assignee: Michelle Caisse
> Fix For: JDO 2 maintenance release 1
>
> Attachments: jdo-576.patch
>
>
> New tests are needed to test getting a persistence manager factory with JDOHelper.getPersistenceManagerFactory() and JDOHelper.getPersistenceManagerFactory(String name);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JDO-576) Create new tests for getting a pmf
using jdoconfig.xml
Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JDO-576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574131#action_12574131 ]
Craig Russell commented on JDO-576:
-----------------------------------
w00t.
> Create new tests for getting a pmf using jdoconfig.xml
> ------------------------------------------------------
>
> Key: JDO-576
> URL: https://issues.apache.org/jira/browse/JDO-576
> Project: JDO
> Issue Type: Test
> Components: tck2, tck2-legacy
> Reporter: Michelle Caisse
> Assignee: Michelle Caisse
> Fix For: JDO 2 maintenance release 1
>
> Attachments: jdo-576.patch
>
>
> New tests are needed to test getting a persistence manager factory with JDOHelper.getPersistenceManagerFactory() and JDOHelper.getPersistenceManagerFactory(String name);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JDO-576) Create new tests for getting a pmf
using jdoconfig.xml
Posted by "Michelle Caisse (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JDO-576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574085#action_12574085 ]
Michelle Caisse commented on JDO-576:
-------------------------------------
I see the same error.
> Create new tests for getting a pmf using jdoconfig.xml
> ------------------------------------------------------
>
> Key: JDO-576
> URL: https://issues.apache.org/jira/browse/JDO-576
> Project: JDO
> Issue Type: Test
> Components: tck2, tck2-legacy
> Reporter: Michelle Caisse
> Assignee: Michelle Caisse
> Fix For: JDO 2 maintenance release 1
>
> Attachments: jdo-576.patch
>
>
> New tests are needed to test getting a persistence manager factory with JDOHelper.getPersistenceManagerFactory() and JDOHelper.getPersistenceManagerFactory(String name);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JDO-576) Create new tests for getting a pmf
using jdoconfig.xml
Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JDO-576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569144#action_12569144 ]
Andy Jefferson commented on JDO-576:
------------------------------------
Tests for jdoconfig dont pass with datastore identity, only app identity
Tests for persistence.xml and JDOHelper assume that the EMF will also implement PMF, and JPOX doesn't implement its EMF that way - they are separate classes. This is an implementation level detail IMHO - as the method JDOHelper.getPersistenceManagerFactory it is user error if the EMF doesnt also implement PMF.
When calling JDOHelper(persistence-unit-name), JDOHelper could do as if the user had instead passed in a Properties with a single property "javax.jdo.option.PersistenceUnitName" set to the puName. In this case JPOX would return a PMF for that persistence-unit. This currently isn't part of JDOHelpers logic AFAIK
> Create new tests for getting a pmf using jdoconfig.xml
> ------------------------------------------------------
>
> Key: JDO-576
> URL: https://issues.apache.org/jira/browse/JDO-576
> Project: JDO
> Issue Type: Test
> Components: tck2, tck2-legacy
> Reporter: Michelle Caisse
> Assignee: Michelle Caisse
> Fix For: JDO 2 maintenance release 1
>
>
> New tests are needed to test getting a persistence manager factory with JDOHelper.getPersistenceManagerFactory() and JDOHelper.getPersistenceManagerFactory(String name);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JDO-576) Create new tests for getting a pmf
using jdoconfig.xml
Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JDO-576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569426#action_12569426 ]
Craig Russell commented on JDO-576:
-----------------------------------
Looking at svn org.jpox.jdo.JDOPersistenceManagerFactory it looks like the signature of the getPersistenceManagerFactory(Map, Map) has the arguments reversed:
/**
123 * Return a new PersistenceManagerFactoryImpl with options set according to the given properties and
124 * given overrides.
125 * @param props Map of properties to initialise the PMF with
126 * @param overrides Map of properties to override the supplied props (if any)
127 * @return A PersistenceManagerFactoryImpl with options set according to the given Properties
128 */
129 public synchronized static PersistenceManagerFactory getPersistenceManagerFactory(Map props, Map overrides)
130 {
131
The signature should be getPersistenceManagerFactory(Map overrides, Map props)
Usually I like to have unambiguous parameters but in this case, having both overrides and props being Map types, it's unavoidable.
Here's a patch:
- public synchronized static PersistenceManagerFactory getPersistenceManagerFactory(Map props, Map overrides)
+ public synchronized static PersistenceManagerFactory getPersistenceManagerFactory(Map overrides, Map props)
> Create new tests for getting a pmf using jdoconfig.xml
> ------------------------------------------------------
>
> Key: JDO-576
> URL: https://issues.apache.org/jira/browse/JDO-576
> Project: JDO
> Issue Type: Test
> Components: tck2, tck2-legacy
> Reporter: Michelle Caisse
> Assignee: Michelle Caisse
> Fix For: JDO 2 maintenance release 1
>
>
> New tests are needed to test getting a persistence manager factory with JDOHelper.getPersistenceManagerFactory() and JDOHelper.getPersistenceManagerFactory(String name);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JDO-576) Create new tests for getting a pmf
using jdoconfig.xml
Posted by "Michelle Caisse (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JDO-576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569130#action_12569130 ]
Michelle Caisse commented on JDO-576:
-------------------------------------
Basic tests for jdoconfig.xml are checked in and pass. Tests for persistence.xml are checked in (revision: 627905) and currently fail.
> Create new tests for getting a pmf using jdoconfig.xml
> ------------------------------------------------------
>
> Key: JDO-576
> URL: https://issues.apache.org/jira/browse/JDO-576
> Project: JDO
> Issue Type: Test
> Components: tck2, tck2-legacy
> Reporter: Michelle Caisse
> Assignee: Michelle Caisse
> Fix For: JDO 2 maintenance release 1
>
>
> New tests are needed to test getting a persistence manager factory with JDOHelper.getPersistenceManagerFactory() and JDOHelper.getPersistenceManagerFactory(String name);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JDO-576) Create new tests for getting a pmf
using jdoconfig.xml
Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JDO-576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574133#action_12574133 ]
Craig Russell commented on JDO-576:
-----------------------------------
I'll keep working on restructuring the JDOHelper now that we know the fix for persistence.xml works. I expect to check it in early next week. Meanwhile, if you have any more comments on JDOHelper, please update this JIRA.
> Create new tests for getting a pmf using jdoconfig.xml
> ------------------------------------------------------
>
> Key: JDO-576
> URL: https://issues.apache.org/jira/browse/JDO-576
> Project: JDO
> Issue Type: Test
> Components: tck2, tck2-legacy
> Reporter: Michelle Caisse
> Assignee: Michelle Caisse
> Fix For: JDO 2 maintenance release 1
>
> Attachments: jdo-576.patch
>
>
> New tests are needed to test getting a persistence manager factory with JDOHelper.getPersistenceManagerFactory() and JDOHelper.getPersistenceManagerFactory(String name);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.