persistence@glassfish.java.net

Re: DDL generation failures in entity-persistence-tests

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Thu, 26 Oct 2006 17:39:46 -0700

Hi Wonseok,

What are the changes in
src/java/oracle/toplink/essentials/testing/models/cmp3/xml/relationships/unidirectional/EmployeePopulator.java

and
src/java/oracle/toplink/essentials/testing/tests/ejb/ejbqltesting/JUnitEJBQLSimpleTestSuite.java

thanks,
-marina

Wonseok Kim wrote:
> I found another bug in JUnitTestCase, please see below diff.
> I added following modification to the attached file.
>
> Thanks,
> - Wonseok
>
> Index:
> src/java/oracle/toplink/essentials/testing/framework/junit/JUnitTestCase.java
>
> ===================================================================
> RCS file:
> /cvs/glassfish/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/framework/junit/JUnitTestCase.java,v
> retrieving revision 1.20
> diff -c -r1.20 JUnitTestCase.java
> ***
> src/java/oracle/toplink/essentials/testing/framework/junit/JUnitTestCase.java
> 19 Oct 2006 19:52:27 -0000 1.20
> ---
> src/java/oracle/toplink/essentials/testing/framework/junit/JUnitTestCase.java
> 26 Oct 2006 15:23:09 -0000
> ***************
> *** 144,150 ****
> }
>
> public static EntityManagerFactory getEntityManagerFactory(String
> persistenceUnitName, Map properties){
> ! EntityManagerFactory emfNamedPersistenceUnit =
> (EntityManagerFactory)emfNamedPersistenceUnits.get("persistenceUnitName");
> if (emfNamedPersistenceUnit == null){
> emfNamedPersistenceUnit =
> Persistence.createEntityManagerFactory(persistenceUnitName, properties);
> emfNamedPersistenceUnits.put(persistenceUnitName,
> emfNamedPersistenceUnit);
> --- 144,150 ----
> }
>
> public static EntityManagerFactory getEntityManagerFactory(String
> persistenceUnitName, Map properties){
> ! EntityManagerFactory emfNamedPersistenceUnit =
> (EntityManagerFactory)emfNamedPersistenceUnits.get(persistenceUnitName);
> if (emfNamedPersistenceUnit == null){
> emfNamedPersistenceUnit =
> Persistence.createEntityManagerFactory(persistenceUnitName, properties);
> emfNamedPersistenceUnits.put(persistenceUnitName,
> emfNamedPersistenceUnit);
> ***************
> *** 173,184 ****
> }
>
> public static void
> closeEntityManagerFactoryNamedPersistenceUnit(String persistenceUnitName) {
> ! EntityManagerFactory emfNamedPersistenceUnit =
> (EntityManagerFactory)emfNamedPersistenceUnits.get("persistenceUnitName");
> if(emfNamedPersistenceUnit != null) {
> if(emfNamedPersistenceUnit.isOpen()) {
> emfNamedPersistenceUnit.close();
> }
> ! emfNamedPersistenceUnit = null;
> }
> }
>
> --- 173,184 ----
> }
>
> public static void
> closeEntityManagerFactoryNamedPersistenceUnit(String persistenceUnitName) {
> ! EntityManagerFactory emfNamedPersistenceUnit =
> (EntityManagerFactory)emfNamedPersistenceUnits.get(persistenceUnitName);
> if(emfNamedPersistenceUnit != null) {
> if(emfNamedPersistenceUnit.isOpen()) {
> emfNamedPersistenceUnit.close();
> }
> ! emfNamedPersistenceUnits.remove (persistenceUnitName);
> }
> }
>
>
> On 10/26/06, *Wonseok Kim* <guruwons_at_gmail.com
> <mailto:guruwons_at_gmail.com>> wrote:
>
> Hi Tom, Marina
> I filed an issue for this.
> https://glassfish.dev.java.net/issues/show_bug.cgi?id=1380
>
> In addition to Tom's modification, I changed some other files
> regarding to the problems shown in my first email.
> * modified nullable column attributes of Buyer to follow the
> specified unique constraints.
> * modified some tests of EntityManagerJUnitTestSuite to show
> occurred exceptions if test failed.
> * added ddl file names to the persistence.xml of
> ddl-generation-testmodel - because default ddl files are overwritten
> by another pu's ddl generation.
>
> I confirmed that tests are running well on clean database.
> Marina, could you check in this(attached) if there is no problem. I
> don't have check-in permission -.-;
>
> Thanks
> - Wonseok
>
>
> On 10/26/06, *Tom Ware* < tom.ware_at_oracle.com
> <mailto:tom.ware_at_oracle.com>> wrote:
>
> Hi Wonsoek,
>
> I fixed the problem by fixing two config files for the tests. I
> tested with clean databases on both Derby and Oracle and on an
> already
> populated Oracle database.
>
> 1. I have removed DDL Generation from the base persistence
> unit. We
> initially added it to try to solve some issues we were having with
> constraints. I think removing it should be fine since the DDL
> Generation is tested in a specific model and all the other
> models are
> covered by TopLink table generation.
>
> 2. I have made a change to one xml file to workaround newly
> added issue
> 1376.
>
> I would like to check these files in, but will need to enter some
> appropriate enhancement requests prior to removing DDL
> generation from
> the base persistence unit. I probably will not get a chance to
> do that
> until Monday. Feel free to check them in if it makes things
> easier for you.
>
> The changes are attached.
>
> -Tom
>
>
>
>