PQ89520: HAVING SYSTEM PROPERTY WHICH CAN BE SET SO THAT THE EJBCREATE() WILL NOT DEFER THE CREATION OF THE BEAN UNTIL EJBPOSTCREATE() | |||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||
![]() APAR status Closed as program error. Error description The APAR PQ65298 (Abstract: UPDATES TO CMP FIELDS MADE IN EJBPOSTCREATE METHOD LOST AFTER A TRANSACTION COMMIT) WENT IN WebSphere Application Server 4.0.6 and above. The APAR PQ65298 was put in place to allow "deferred creation" of the entity bean after the ejbPostCreate was called. This was done to increase performance and inline with the EJB Specification guidelines. . Here is a quote from the specification (Section 9.4.2 ejbCreate, ejbPostCreate): ... The container is responsible for creating the entity object's representation in the underlying database, extracting the primary key fields of the newly created entity object representation in the database, and for creating an entity EJBObject reference for the newly created entity object. The Container must establish the primary key before it invokes the ejbPostCreate(...) method. The container may create the representation of the entity in the database immediately after ejbCreate(...) returns, or it can defer it to a later time (for example to the time after the matching ejbPostCreate(...) has been called, or to the end of the transaction)." ... . Due to the limitation of EJB 1.0, customer had to create related beans in the ejbPostCreate() and therefore the entity insertion after ejbPostCreate() is preventing them from doing so. . This APAR is opened to create a system property which can be set so that the ejbCreate method will not defer creation of the bean until the ejbPostCreate.Local fix Problem summary **************************************************************** * USERS AFFECTED: CMP1.1 Enterprise Java Bean (EJB) * * developers who rely on a record being * * created in the database when method * * ejbCreate exits. * **************************************************************** * PROBLEM DESCRIPTION: An error message indicating: * * Integrity constraint or foreign key * * contraint violated. Parent key not * * found. * **************************************************************** * RECOMMENDATION: * **************************************************************** By default, EJBContainer inserts a record in the database at the end of ejbPostCreate. However, some EJB1.1 applications which rely on a record being created in ejbCreate method and then go on to create another record in ejbPostCreate, which has a foreign key dependency on the previous step, will get 'Integrity Contraints' violated message.Problem conclusion Although the Application Server is working as designed, it is possible that legacy applications which rely on a certain behaviour ofthe EJB container would need this fix to continue working. A JVM property "com.ibm.websphere.ejbcontainer.allowEarlyInsert" when set to true allows creation of a record in ejbCreate.Temporary fix Gave customer cumulative 4.0.x fix to test.Comments
APAR is sysrouted FROM one or more of the following: APAR is sysrouted TO one or more of the following: Modules/Macros
SRLS
|
Document Information |
Product categories: Software > Application Servers >
Distributed Application & Web Servers > WebSphere Application
Server > General
Operating system(s):
Software version: 400
Software edition:
Reference #: PQ89520
IBM Group: Software Group
Modified date: Jul 1, 2004
(C) Copyright IBM Corporation 2000, 2006. All Rights Reserved.