================================================================================ Merge Diffs: /ade/ailitche_toplink_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/base/EntityManagerImpl.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/ailitche/ailitche_ri_em_reference_factory_060512/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.32 Report generated at Fri May 12 10:52:28 2006 -------------------------------------------------------------------------------- *** /ade/ailitche_toplink_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/base/EntityManagerImpl.java Fri May 12 10:52:28 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/ailitche/ailitche_ri_em_reference_factory_060512/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.32 Fri May 12 11:34:27 2006 *************** *** 73,81 **** //THis attribute references the ServerSession that this deployement is using. //This is a simple mechanism to reduce the number of SessionManager accesses. protected ServerSession serverSession; - // References the factory that has created this entity manager - // to make sure that the factory is not garbage collected - protected EntityManagerFactoryImpl factory; //We have not removed these flags because we may want to use them at a later date to provide transactional EntityManagers in JAVA SE protected boolean extended; --- 73,78 ---- *************** *** 122,141 **** } /** - * Constructor called from the EntityManagerFactory to create an EntityManager - * @param factory the EntityMangerFactoryImpl that created this entity manager. - * Note: The properties argument is provided to allow properties to be passed into this EntityManager, - * but there are currently no such properties implemented - */ - public EntityManagerImpl(EntityManagerFactoryImpl factory, Map properties, boolean propagatePersistenceContext, boolean extended){ - this.factory = factory; - this.serverSession = factory.getServerSession(); - detectTransactionWrapper(); - this.extended = true; - this.propagatePersistenceContext = false; - } - - /** * Clear the persistence context, causing all managed * entities to become detached. Changes made to entities that * have not been flushed to the database will not be --- 119,124 ---- *************** *** 452,476 **** public void close(){ verifyOpen(); isOpen = false; ! try { ! if (transaction.shouldClose()){ ! if (this.isExtended()){ ! if (this.extendedPersistenceContext != null) { ! this.extendedPersistenceContext.release(); ! this.extendedPersistenceContext.getParent().release(); ! } } ! } else { ! if (this.isExtended()){ ! if (this.extendedPersistenceContext != null) { ! this.extendedPersistenceContext.setResumeUnitOfWorkOnTransactionCompletion(false); ! } } - this.transaction.markLastTransaction(); } ! } finally { ! factory = null; ! serverSession = null; } } --- 435,454 ---- public void close(){ verifyOpen(); isOpen = false; ! if (transaction.shouldClose()){ ! if (this.isExtended()){ ! if (this.extendedPersistenceContext != null) { ! this.extendedPersistenceContext.release(); ! this.extendedPersistenceContext.getParent().release(); } ! } ! } else { ! if (this.isExtended()){ ! if (this.extendedPersistenceContext != null) { ! this.extendedPersistenceContext.setResumeUnitOfWorkOnTransactionCompletion(false); } } ! this.transaction.markLastTransaction(); } } *************** *** 572,584 **** public void joinTransaction(){ transaction.registerUnitOfWorkWithTxn(getActivePersistenceContext(checkForTransaction(true))); } - - /** - * - */ - protected void finalize() throws Throwable { - if(isOpen()) { - close(); - } - } } --- 550,553 ---- ================================================================================ Merge Diffs: /ade/ailitche_toplink_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/EntityManagerImpl.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/ailitche/ailitche_ri_em_reference_factory_060512/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.14 Report generated at Fri May 12 10:52:28 2006 -------------------------------------------------------------------------------- *** /ade/ailitche_toplink_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/EntityManagerImpl.java Fri May 12 10:52:28 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/ailitche/ailitche_ri_em_reference_factory_060512/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.14 Fri May 12 11:34:35 2006 *************** *** 89,105 **** flushMode = FlushModeType.AUTO; } - /** - * Constructor called from the EntityManagerFactory to create an EntityManager - * @param factory the EntityMangerFactoryImpl that created this entity manager. - * Note: The properties argument is provided to allow properties to be passed into this EntityManager, - * but there are currently no such properties implemented - */ - public EntityManagerImpl(EntityManagerFactoryImpl factory, Map properties, boolean propagePersistenceContext, boolean extended){ - super(factory, properties, propagePersistenceContext, extended); - flushMode = FlushModeType.AUTO; - } - /** * Merge the state of the given entity into the * current persistence context, using the unqualified --- 89,94 ---- ================================================================================ Merge Diffs: /ade/ailitche_toplink_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/EntityManagerFactoryImpl.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/ailitche/ailitche_ri_em_reference_factory_060512/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.11 Report generated at Fri May 12 10:52:28 2006 -------------------------------------------------------------------------------- *** /ade/ailitche_toplink_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/EntityManagerFactoryImpl.java Fri May 12 10:52:28 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/ailitche/ailitche_ri_em_reference_factory_060512/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.11 Fri May 12 11:34:41 2006 *************** *** 86,91 **** //TODO change the way create works to deal with how the specification works with persistence contexts protected oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl createEntityManagerImplInternal(Map properties, boolean extended) { ! return new EntityManagerImpl(this, properties, false, extended); } } --- 86,91 ---- //TODO change the way create works to deal with how the specification works with persistence contexts protected oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl createEntityManagerImplInternal(Map properties, boolean extended) { ! return new EntityManagerImpl(getServerSession(), properties, false, extended); } } ================================================================================ Merge Diffs: /ade/ailitche_toplink_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/tests/ejb/ejbqltesting/JUnitEJBQLValidationTestSuite.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/ailitche/ailitche_ri_em_reference_factory_060512/ade_storage/000004/AB0952363AC40CBFE034080020E8C54E.21 Report generated at Fri May 12 10:52:28 2006 -------------------------------------------------------------------------------- *** /ade/ailitche_toplink_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/tests/ejb/ejbqltesting/JUnitEJBQLValidationTestSuite.java Fri May 12 10:52:28 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/ailitche/ailitche_ri_em_reference_factory_060512/ade_storage/000004/AB0952363AC40CBFE034080020E8C54E.21 Fri May 12 11:36:22 2006 *************** *** 46,52 **** import java.util.List; ! import javax.persistence.NoResultException; import javax.persistence.OptimisticLockException; import javax.persistence.Persistence; --- 46,52 ---- import java.util.List; ! import javax.persistence.EntityManagerFactory; import javax.persistence.NoResultException; import javax.persistence.OptimisticLockException; import javax.persistence.Persistence; *************** *** 94,99 **** --- 94,101 ---- { static JUnitDomainObjectComparer comparer; //the global comparer object used in all tests + static EntityManagerFactory alternativeEmf; + public JUnitEJBQLValidationTestSuite() { super(); *************** *** 108,113 **** --- 110,116 ---- public void tearDown() { clearCache(); + clearAlternativeEmf(); } //This suite contains all tests contained in this class *************** *** 809,817 **** } public static EntityManager createAlternateEntityManager() { ! return (EntityManager) Persistence.createEntityManagerFactory("default1", getDatabaseProperties()).createEntityManager(); } public static void main(String[] args) { junit.swingui.TestRunner.main(args); --- 812,835 ---- } public static EntityManager createAlternateEntityManager() { ! if(alternativeEmf != null && !alternativeEmf.isOpen()) { ! alternativeEmf = null; ! } ! if(alternativeEmf == null) { ! alternativeEmf = Persistence.createEntityManagerFactory("default1", getDatabaseProperties()); ! } ! return alternativeEmf.createEntityManager(); } + public static void clearAlternativeEmf() { + if(alternativeEmf != null) { + if(alternativeEmf.isOpen()) { + alternativeEmf.close(); + } + alternativeEmf = null; + } + } + public static void main(String[] args) { junit.swingui.TestRunner.main(args); ================================================================================ Merge Diffs: /ade/ailitche_toplink_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/base/EntityManagerImpl.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/ailitche/ailitche_ri_em_reference_factory_060512/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.32 Report generated at Fri May 12 10:53:00 2006 -------------------------------------------------------------------------------- *** /ade/ailitche_toplink_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/base/EntityManagerImpl.java Fri May 12 10:52:28 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/ailitche/ailitche_ri_em_reference_factory_060512/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.32 Fri May 12 11:34:27 2006 *************** *** 73,81 **** //THis attribute references the ServerSession that this deployement is using. //This is a simple mechanism to reduce the number of SessionManager accesses. protected ServerSession serverSession; - // References the factory that has created this entity manager - // to make sure that the factory is not garbage collected - protected EntityManagerFactoryImpl factory; //We have not removed these flags because we may want to use them at a later date to provide transactional EntityManagers in JAVA SE protected boolean extended; --- 73,78 ---- *************** *** 122,141 **** } /** - * Constructor called from the EntityManagerFactory to create an EntityManager - * @param factory the EntityMangerFactoryImpl that created this entity manager. - * Note: The properties argument is provided to allow properties to be passed into this EntityManager, - * but there are currently no such properties implemented - */ - public EntityManagerImpl(EntityManagerFactoryImpl factory, Map properties, boolean propagatePersistenceContext, boolean extended){ - this.factory = factory; - this.serverSession = factory.getServerSession(); - detectTransactionWrapper(); - this.extended = true; - this.propagatePersistenceContext = false; - } - - /** * Clear the persistence context, causing all managed * entities to become detached. Changes made to entities that * have not been flushed to the database will not be --- 119,124 ---- *************** *** 452,476 **** public void close(){ verifyOpen(); isOpen = false; ! try { ! if (transaction.shouldClose()){ ! if (this.isExtended()){ ! if (this.extendedPersistenceContext != null) { ! this.extendedPersistenceContext.release(); ! this.extendedPersistenceContext.getParent().release(); ! } } ! } else { ! if (this.isExtended()){ ! if (this.extendedPersistenceContext != null) { ! this.extendedPersistenceContext.setResumeUnitOfWorkOnTransactionCompletion(false); ! } } - this.transaction.markLastTransaction(); } ! } finally { ! factory = null; ! serverSession = null; } } --- 435,454 ---- public void close(){ verifyOpen(); isOpen = false; ! if (transaction.shouldClose()){ ! if (this.isExtended()){ ! if (this.extendedPersistenceContext != null) { ! this.extendedPersistenceContext.release(); ! this.extendedPersistenceContext.getParent().release(); } ! } ! } else { ! if (this.isExtended()){ ! if (this.extendedPersistenceContext != null) { ! this.extendedPersistenceContext.setResumeUnitOfWorkOnTransactionCompletion(false); } } ! this.transaction.markLastTransaction(); } } *************** *** 572,584 **** public void joinTransaction(){ transaction.registerUnitOfWorkWithTxn(getActivePersistenceContext(checkForTransaction(true))); } - - /** - * - */ - protected void finalize() throws Throwable { - if(isOpen()) { - close(); - } - } } --- 550,553 ---- ================================================================================ Merge Diffs: /ade/ailitche_toplink_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/EntityManagerImpl.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/ailitche/ailitche_ri_em_reference_factory_060512/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.14 Report generated at Fri May 12 10:53:00 2006 -------------------------------------------------------------------------------- *** /ade/ailitche_toplink_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/EntityManagerImpl.java Fri May 12 10:52:28 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/ailitche/ailitche_ri_em_reference_factory_060512/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.14 Fri May 12 11:34:35 2006 *************** *** 89,105 **** flushMode = FlushModeType.AUTO; } - /** - * Constructor called from the EntityManagerFactory to create an EntityManager - * @param factory the EntityMangerFactoryImpl that created this entity manager. - * Note: The properties argument is provided to allow properties to be passed into this EntityManager, - * but there are currently no such properties implemented - */ - public EntityManagerImpl(EntityManagerFactoryImpl factory, Map properties, boolean propagePersistenceContext, boolean extended){ - super(factory, properties, propagePersistenceContext, extended); - flushMode = FlushModeType.AUTO; - } - /** * Merge the state of the given entity into the * current persistence context, using the unqualified --- 89,94 ---- ================================================================================ Merge Diffs: /ade/ailitche_toplink_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/EntityManagerFactoryImpl.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/ailitche/ailitche_ri_em_reference_factory_060512/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.11 Report generated at Fri May 12 10:53:00 2006 -------------------------------------------------------------------------------- *** /ade/ailitche_toplink_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/EntityManagerFactoryImpl.java Fri May 12 10:52:28 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/ailitche/ailitche_ri_em_reference_factory_060512/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.11 Fri May 12 11:34:41 2006 *************** *** 86,91 **** //TODO change the way create works to deal with how the specification works with persistence contexts protected oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl createEntityManagerImplInternal(Map properties, boolean extended) { ! return new EntityManagerImpl(this, properties, false, extended); } } --- 86,91 ---- //TODO change the way create works to deal with how the specification works with persistence contexts protected oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl createEntityManagerImplInternal(Map properties, boolean extended) { ! return new EntityManagerImpl(getServerSession(), properties, false, extended); } } ================================================================================ Merge Diffs: /ade/ailitche_toplink_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/tests/ejb/ejbqltesting/JUnitEJBQLValidationTestSuite.java vs. /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/ailitche/ailitche_ri_em_reference_factory_060512/ade_storage/000004/AB0952363AC40CBFE034080020E8C54E.21 Report generated at Fri May 12 10:53:00 2006 -------------------------------------------------------------------------------- *** /ade/ailitche_toplink_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/tests/ejb/ejbqltesting/JUnitEJBQLValidationTestSuite.java Fri May 12 10:52:28 2006 --- /net/ottnfs1.ca.oracle.com/vol/vol1/ade_ottawa_txn/ailitche/ailitche_ri_em_reference_factory_060512/ade_storage/000004/AB0952363AC40CBFE034080020E8C54E.21 Fri May 12 11:36:22 2006 *************** *** 46,52 **** import java.util.List; ! import javax.persistence.NoResultException; import javax.persistence.OptimisticLockException; import javax.persistence.Persistence; --- 46,52 ---- import java.util.List; ! import javax.persistence.EntityManagerFactory; import javax.persistence.NoResultException; import javax.persistence.OptimisticLockException; import javax.persistence.Persistence; *************** *** 94,99 **** --- 94,101 ---- { static JUnitDomainObjectComparer comparer; //the global comparer object used in all tests + static EntityManagerFactory alternativeEmf; + public JUnitEJBQLValidationTestSuite() { super(); *************** *** 108,113 **** --- 110,116 ---- public void tearDown() { clearCache(); + clearAlternativeEmf(); } //This suite contains all tests contained in this class *************** *** 809,817 **** } public static EntityManager createAlternateEntityManager() { ! return (EntityManager) Persistence.createEntityManagerFactory("default1", getDatabaseProperties()).createEntityManager(); } public static void main(String[] args) { junit.swingui.TestRunner.main(args); --- 812,835 ---- } public static EntityManager createAlternateEntityManager() { ! if(alternativeEmf != null && !alternativeEmf.isOpen()) { ! alternativeEmf = null; ! } ! if(alternativeEmf == null) { ! alternativeEmf = Persistence.createEntityManagerFactory("default1", getDatabaseProperties()); ! } ! return alternativeEmf.createEntityManager(); } + public static void clearAlternativeEmf() { + if(alternativeEmf != null) { + if(alternativeEmf.isOpen()) { + alternativeEmf.close(); + } + alternativeEmf = null; + } + } + public static void main(String[] args) { junit.swingui.TestRunner.main(args);