================================================================================ Merge Diffs: /ade/tware_toplink10i/tldev/source/essentials/oracle/toplink/essentials/exceptions/ValidationException.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.53 Report generated at Thu Jun 15 15:00:05 2006 -------------------------------------------------------------------------------- *** /ade/tware_toplink10i/tldev/source/essentials/oracle/toplink/essentials/exceptions/ValidationException.java Thu Jun 15 15:00:05 2006 --- /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.53 Thu Jun 15 14:11:27 2006 *************** *** 295,301 **** public static final int CONFLICTING_SEQUENCE_GENERATORS_SPECIFIED = 7239; public static final int CONFLICTING_SEQUENCE_NAME_AND_TABLE_PK_COLUMN_VALUE_SPECIFIED = 7240; public static final int CONFLICTING_TABLE_GENERATORS_SPECIFIED = 7241; - public static final int INSTANTIATING_VALUEHOLDER_WITH_NULL_SESSION = 7242; /** * INTERNAL: --- 295,300 ---- *************** *** 851,864 **** return validationException; } - public static ValidationException instantiatingValueholderWithNullSession() { - Object[] args = { }; - - ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INSTANTIATING_VALUEHOLDER_WITH_NULL_SESSION, args)); - validationException.setErrorCode(INSTANTIATING_VALUEHOLDER_WITH_NULL_SESSION); - return validationException; - } - /** * PUBLIC: * Possible cause: A mapping for the attribute name specified in the attribute-override cannot be found --- 850,855 ---- ================================================================================ Merge Diffs: /ade/tware_toplink10i/tldev/source/essentials/oracle/toplink/essentials/exceptions/i18n/ValidationExceptionResource.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.53 Report generated at Thu Jun 15 15:00:05 2006 -------------------------------------------------------------------------------- *** /ade/tware_toplink10i/tldev/source/essentials/oracle/toplink/essentials/exceptions/i18n/ValidationExceptionResource.java Thu Jun 15 15:00:05 2006 --- /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.53 Thu Jun 15 14:11:41 2006 *************** *** 241,248 **** { "7238", "The table generator specified in [{2}] with name == [{0}] conflicts with the sequence generator with the same name specified in [{1}]."}, { "7239", "The sequence generator specified in [{2}] with name == [{0}] conflicts with another sequence generator with the same name in [{1}]."}, { "7240", "The table generator specified in [{2}] with pk column value == [{0}] conflicts with the sequence generator specified in [{1}] with sequence name == [{0}]. They cannot use the same value."}, ! { "7241", "The table generator specified in [{2}] with name == [{0}] conflicts with another table generator with the same name in [{1}]."}, ! { "7242", "An attempt was made to traverse a relationship using indirection that had a null Session. This often occurs when an entity with an uninstantiated LAZY relationship is serialized and that lazy relationship is traversed after serialization. To avoid this issue, instantiate the LAZY relationship prior to serialization."} }; /** --- 241,247 ---- { "7238", "The table generator specified in [{2}] with name == [{0}] conflicts with the sequence generator with the same name specified in [{1}]."}, { "7239", "The sequence generator specified in [{2}] with name == [{0}] conflicts with another sequence generator with the same name in [{1}]."}, { "7240", "The table generator specified in [{2}] with pk column value == [{0}] conflicts with the sequence generator specified in [{1}] with sequence name == [{0}]. They cannot use the same value."}, ! { "7241", "The table generator specified in [{2}] with name == [{0}] conflicts with another table generator with the same name in [{1}]."} }; /** ================================================================================ Merge Diffs: /ade/tware_toplink10i/tldev/source/essentials/oracle/toplink/essentials/internal/indirection/UnitOfWorkValueHolder.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.7 Report generated at Thu Jun 15 15:00:05 2006 -------------------------------------------------------------------------------- *** /ade/tware_toplink10i/tldev/source/essentials/oracle/toplink/essentials/internal/indirection/UnitOfWorkValueHolder.java Thu Jun 15 15:00:05 2006 --- /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.7 Thu Jun 15 14:11:54 2006 *************** *** 18,24 **** * own identifying information: Portions Copyright [yyyy] * [name of copyright owner] */ ! // Copyright (c) 1998, 2006, Oracle. All rights reserved. package oracle.toplink.essentials.internal.indirection; import java.util.*; --- 18,24 ---- * own identifying information: Portions Copyright [yyyy] * [name of copyright owner] */ ! // Copyright (c) 1998, 2005, Oracle. All rights reserved. package oracle.toplink.essentials.internal.indirection; import java.util.*; *************** *** 214,222 **** } else { unitOfWork = getUnitOfWork(); } - if (unitOfWork == null){ - throw ValidationException.instantiatingValueholderWithNullSession(); - } if (unitOfWork.isAfterWriteChangesButBeforeCommit()) { throw ValidationException.illegalOperationForUnitOfWorkLifecycle(unitOfWork.getLifecycle(), "ValueHolder.instantiate()"); } --- 214,219 ---- ================================================================================ Merge Diffs: /ade/tware_toplink10i/tldev/source/essentials/oracle/toplink/essentials/internal/indirection/QueryBasedValueHolder.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000004/AB0952363AC40CBFE034080020E8C54E.5 Report generated at Thu Jun 15 15:00:05 2006 -------------------------------------------------------------------------------- *** /ade/tware_toplink10i/tldev/source/essentials/oracle/toplink/essentials/internal/indirection/QueryBasedValueHolder.java Thu Jun 15 15:00:05 2006 --- /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000004/AB0952363AC40CBFE034080020E8C54E.5 Thu Jun 15 14:12:03 2006 *************** *** 18,24 **** * own identifying information: Portions Copyright [yyyy] * [name of copyright owner] */ ! // Copyright (c) 1998, 2006, Oracle. All rights reserved. package oracle.toplink.essentials.internal.indirection; import oracle.toplink.essentials.queryframework.*; --- 18,24 ---- * own identifying information: Portions Copyright [yyyy] * [name of copyright owner] */ ! // Copyright (c) 1998, 2005, Oracle. All rights reserved. package oracle.toplink.essentials.internal.indirection; import oracle.toplink.essentials.queryframework.*; *************** *** 80,88 **** * Instantiate the object by executing the query on the session. */ protected Object instantiate(AbstractSession session) throws DatabaseException { - if (session == null){ - throw ValidationException.instantiatingValueholderWithNullSession(); - } return session.executeQuery(getQuery(), getRow()); } --- 80,85 ---- ================================================================================ Merge Diffs: /ade/tware_toplink10i/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/tests/cmp3/advanced/EntityManagerJUnitTestSuite.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000005/AB0952363AC40CBFE034080020E8C54E.36 Report generated at Thu Jun 15 15:00:05 2006 -------------------------------------------------------------------------------- *** /ade/tware_toplink10i/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/tests/cmp3/advanced/EntityManagerJUnitTestSuite.java Thu Jun 15 15:00:05 2006 --- /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000005/AB0952363AC40CBFE034080020E8C54E.36 Thu Jun 15 14:15:31 2006 *************** *** 23,32 **** package oracle.toplink.essentials.testing.tests.cmp3.advanced; - import java.io.ByteArrayInputStream; - import java.io.ByteArrayOutputStream; - import java.io.ObjectInputStream; - import java.io.ObjectOutputStream; import java.util.List; import javax.persistence.EntityExistsException; --- 23,28 ---- *************** *** 67,73 **** import oracle.toplink.essentials.testing.models.cmp3.advanced.Project; import oracle.toplink.essentials.threetier.ReadConnectionPool; import oracle.toplink.essentials.threetier.ServerSession; - import oracle.toplink.essentials.exceptions.ValidationException; public class EntityManagerJUnitTestSuite extends JUnitTestCase { --- 63,68 ---- *************** *** 2073,2129 **** em.close(); } - // test for GlassFish bug 711 - throw a descriptive exception when an uninstantiated valueholder is serialized and then accessed - public void testSerializedLazy(){ - oracle.toplink.essentials.ejb.cmp3.EntityManager em = (oracle.toplink.essentials.ejb.cmp3.EntityManager) createEntityManager(); - - em.getTransaction().begin(); - - Employee emp = new Employee(); - emp.setFirstName("Owen"); - emp.setLastName("Hargreaves"); - Address address = new Address(); - address.setCity("Munich"); - emp.setAddress(address); - em.persist(emp); - em.flush(); - em.getTransaction().commit(); - em.close(); - clearCache(); - em = (oracle.toplink.essentials.ejb.cmp3.EntityManager) createEntityManager(); - String ejbqlString = "SELECT e FROM Employee e WHERE e.address IS NOT NULL"; - List result = em.createQuery(ejbqlString).getResultList(); - emp = (Employee)result.get(0); - Exception exception = null; - try { - ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); - ObjectOutputStream stream = new ObjectOutputStream(byteStream); - - stream.writeObject(emp); - stream.flush(); - byte arr[] = byteStream.toByteArray(); - ByteArrayInputStream inByteStream = new ByteArrayInputStream(arr); - ObjectInputStream inObjStream = new ObjectInputStream(inByteStream); - - emp = (Employee) inObjStream.readObject(); - emp.getAddress(); - } catch (ValidationException e) { - if (e.getErrorCode() == ValidationException.INSTANTIATING_VALUEHOLDER_WITH_NULL_SESSION){ - exception = e; - } else { - fail("An unexpected exception was thrown while testing serialization of ValueHolders: " + e.toString()); - } - } catch (Exception e){ - fail("An unexpected exception was thrown while testing serialization of ValueHolders: " + e.toString()); - } - - assertNotNull("The correct exception was not thrown while traversing an uninstantiated lazy relationship on a serialized object: " + exception, exception); - em.getTransaction().begin(); - emp = (Employee)em.find(Employee.class, emp.getId()); - em.remove(emp); - em.getTransaction().commit(); - } - public static void main(String[] args) { // Now run JUnit. junit.swingui.TestRunner.main(args); --- 2068,2073 ---- ================================================================================ Merge Diffs: /ade/tware_toplink10i/tldev/source/essentials/oracle/toplink/essentials/exceptions/ValidationException.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.53 Report generated at Thu Jun 15 15:01:04 2006 -------------------------------------------------------------------------------- *** /ade/tware_toplink10i/tldev/source/essentials/oracle/toplink/essentials/exceptions/ValidationException.java Thu Jun 15 15:00:05 2006 --- /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.53 Thu Jun 15 14:11:27 2006 *************** *** 295,301 **** public static final int CONFLICTING_SEQUENCE_GENERATORS_SPECIFIED = 7239; public static final int CONFLICTING_SEQUENCE_NAME_AND_TABLE_PK_COLUMN_VALUE_SPECIFIED = 7240; public static final int CONFLICTING_TABLE_GENERATORS_SPECIFIED = 7241; - public static final int INSTANTIATING_VALUEHOLDER_WITH_NULL_SESSION = 7242; /** * INTERNAL: --- 295,300 ---- *************** *** 851,864 **** return validationException; } - public static ValidationException instantiatingValueholderWithNullSession() { - Object[] args = { }; - - ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, INSTANTIATING_VALUEHOLDER_WITH_NULL_SESSION, args)); - validationException.setErrorCode(INSTANTIATING_VALUEHOLDER_WITH_NULL_SESSION); - return validationException; - } - /** * PUBLIC: * Possible cause: A mapping for the attribute name specified in the attribute-override cannot be found --- 850,855 ---- ================================================================================ Merge Diffs: /ade/tware_toplink10i/tldev/source/essentials/oracle/toplink/essentials/exceptions/i18n/ValidationExceptionResource.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.53 Report generated at Thu Jun 15 15:01:04 2006 -------------------------------------------------------------------------------- *** /ade/tware_toplink10i/tldev/source/essentials/oracle/toplink/essentials/exceptions/i18n/ValidationExceptionResource.java Thu Jun 15 15:00:05 2006 --- /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.53 Thu Jun 15 14:11:41 2006 *************** *** 241,248 **** { "7238", "The table generator specified in [{2}] with name == [{0}] conflicts with the sequence generator with the same name specified in [{1}]."}, { "7239", "The sequence generator specified in [{2}] with name == [{0}] conflicts with another sequence generator with the same name in [{1}]."}, { "7240", "The table generator specified in [{2}] with pk column value == [{0}] conflicts with the sequence generator specified in [{1}] with sequence name == [{0}]. They cannot use the same value."}, ! { "7241", "The table generator specified in [{2}] with name == [{0}] conflicts with another table generator with the same name in [{1}]."}, ! { "7242", "An attempt was made to traverse a relationship using indirection that had a null Session. This often occurs when an entity with an uninstantiated LAZY relationship is serialized and that lazy relationship is traversed after serialization. To avoid this issue, instantiate the LAZY relationship prior to serialization."} }; /** --- 241,247 ---- { "7238", "The table generator specified in [{2}] with name == [{0}] conflicts with the sequence generator with the same name specified in [{1}]."}, { "7239", "The sequence generator specified in [{2}] with name == [{0}] conflicts with another sequence generator with the same name in [{1}]."}, { "7240", "The table generator specified in [{2}] with pk column value == [{0}] conflicts with the sequence generator specified in [{1}] with sequence name == [{0}]. They cannot use the same value."}, ! { "7241", "The table generator specified in [{2}] with name == [{0}] conflicts with another table generator with the same name in [{1}]."} }; /** ================================================================================ Merge Diffs: /ade/tware_toplink10i/tldev/source/essentials/oracle/toplink/essentials/internal/indirection/UnitOfWorkValueHolder.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.7 Report generated at Thu Jun 15 15:01:04 2006 -------------------------------------------------------------------------------- *** /ade/tware_toplink10i/tldev/source/essentials/oracle/toplink/essentials/internal/indirection/UnitOfWorkValueHolder.java Thu Jun 15 15:00:05 2006 --- /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.7 Thu Jun 15 14:11:54 2006 *************** *** 18,24 **** * own identifying information: Portions Copyright [yyyy] * [name of copyright owner] */ ! // Copyright (c) 1998, 2006, Oracle. All rights reserved. package oracle.toplink.essentials.internal.indirection; import java.util.*; --- 18,24 ---- * own identifying information: Portions Copyright [yyyy] * [name of copyright owner] */ ! // Copyright (c) 1998, 2005, Oracle. All rights reserved. package oracle.toplink.essentials.internal.indirection; import java.util.*; *************** *** 214,222 **** } else { unitOfWork = getUnitOfWork(); } - if (unitOfWork == null){ - throw ValidationException.instantiatingValueholderWithNullSession(); - } if (unitOfWork.isAfterWriteChangesButBeforeCommit()) { throw ValidationException.illegalOperationForUnitOfWorkLifecycle(unitOfWork.getLifecycle(), "ValueHolder.instantiate()"); } --- 214,219 ---- ================================================================================ Merge Diffs: /ade/tware_toplink10i/tldev/source/essentials/oracle/toplink/essentials/internal/indirection/QueryBasedValueHolder.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000004/AB0952363AC40CBFE034080020E8C54E.5 Report generated at Thu Jun 15 15:01:04 2006 -------------------------------------------------------------------------------- *** /ade/tware_toplink10i/tldev/source/essentials/oracle/toplink/essentials/internal/indirection/QueryBasedValueHolder.java Thu Jun 15 15:00:05 2006 --- /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000004/AB0952363AC40CBFE034080020E8C54E.5 Thu Jun 15 14:12:03 2006 *************** *** 18,24 **** * own identifying information: Portions Copyright [yyyy] * [name of copyright owner] */ ! // Copyright (c) 1998, 2006, Oracle. All rights reserved. package oracle.toplink.essentials.internal.indirection; import oracle.toplink.essentials.queryframework.*; --- 18,24 ---- * own identifying information: Portions Copyright [yyyy] * [name of copyright owner] */ ! // Copyright (c) 1998, 2005, Oracle. All rights reserved. package oracle.toplink.essentials.internal.indirection; import oracle.toplink.essentials.queryframework.*; *************** *** 80,88 **** * Instantiate the object by executing the query on the session. */ protected Object instantiate(AbstractSession session) throws DatabaseException { - if (session == null){ - throw ValidationException.instantiatingValueholderWithNullSession(); - } return session.executeQuery(getQuery(), getRow()); } --- 80,85 ---- ================================================================================ Merge Diffs: /ade/tware_toplink10i/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/tests/cmp3/advanced/EntityManagerJUnitTestSuite.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000005/AB0952363AC40CBFE034080020E8C54E.36 Report generated at Thu Jun 15 15:01:04 2006 -------------------------------------------------------------------------------- *** /ade/tware_toplink10i/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/tests/cmp3/advanced/EntityManagerJUnitTestSuite.java Thu Jun 15 15:00:05 2006 --- /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/tware/tware_10essentials_gf711_valueholder_instantiation_exception_060615/ade_storage/000005/AB0952363AC40CBFE034080020E8C54E.36 Thu Jun 15 14:15:31 2006 *************** *** 23,32 **** package oracle.toplink.essentials.testing.tests.cmp3.advanced; - import java.io.ByteArrayInputStream; - import java.io.ByteArrayOutputStream; - import java.io.ObjectInputStream; - import java.io.ObjectOutputStream; import java.util.List; import javax.persistence.EntityExistsException; --- 23,28 ---- *************** *** 67,73 **** import oracle.toplink.essentials.testing.models.cmp3.advanced.Project; import oracle.toplink.essentials.threetier.ReadConnectionPool; import oracle.toplink.essentials.threetier.ServerSession; - import oracle.toplink.essentials.exceptions.ValidationException; public class EntityManagerJUnitTestSuite extends JUnitTestCase { --- 63,68 ---- *************** *** 2073,2129 **** em.close(); } - // test for GlassFish bug 711 - throw a descriptive exception when an uninstantiated valueholder is serialized and then accessed - public void testSerializedLazy(){ - oracle.toplink.essentials.ejb.cmp3.EntityManager em = (oracle.toplink.essentials.ejb.cmp3.EntityManager) createEntityManager(); - - em.getTransaction().begin(); - - Employee emp = new Employee(); - emp.setFirstName("Owen"); - emp.setLastName("Hargreaves"); - Address address = new Address(); - address.setCity("Munich"); - emp.setAddress(address); - em.persist(emp); - em.flush(); - em.getTransaction().commit(); - em.close(); - clearCache(); - em = (oracle.toplink.essentials.ejb.cmp3.EntityManager) createEntityManager(); - String ejbqlString = "SELECT e FROM Employee e WHERE e.address IS NOT NULL"; - List result = em.createQuery(ejbqlString).getResultList(); - emp = (Employee)result.get(0); - Exception exception = null; - try { - ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); - ObjectOutputStream stream = new ObjectOutputStream(byteStream); - - stream.writeObject(emp); - stream.flush(); - byte arr[] = byteStream.toByteArray(); - ByteArrayInputStream inByteStream = new ByteArrayInputStream(arr); - ObjectInputStream inObjStream = new ObjectInputStream(inByteStream); - - emp = (Employee) inObjStream.readObject(); - emp.getAddress(); - } catch (ValidationException e) { - if (e.getErrorCode() == ValidationException.INSTANTIATING_VALUEHOLDER_WITH_NULL_SESSION){ - exception = e; - } else { - fail("An unexpected exception was thrown while testing serialization of ValueHolders: " + e.toString()); - } - } catch (Exception e){ - fail("An unexpected exception was thrown while testing serialization of ValueHolders: " + e.toString()); - } - - assertNotNull("The correct exception was not thrown while traversing an uninstantiated lazy relationship on a serialized object: " + exception, exception); - em.getTransaction().begin(); - emp = (Employee)em.find(Employee.class, emp.getId()); - em.remove(emp); - em.getTransaction().commit(); - } - public static void main(String[] args) { // Now run JUnit. junit.swingui.TestRunner.main(args); --- 2068,2073 ----