<container-configurations> <container-configuration extends="Standard CMP 2.x EntityBean"> <container-name>INSERT after ejbPostCreate Container</container-name> <insert-after-ejb-post-create>true</insert-after-ejb-post-create> </container-configuration> </container-configurations>
I think that flag is to specify whether the insert has to be called before ejbPostCreate() or after ejbPostCreate();
Possible values are:
false - the default value, INSERT will be executed after ejbCreate but before
true - INSERT will be executed after ejbPostCreate.
I tried by changing that to - true. I am getting an exception
javax.ejb.CreateException: Primary key for created instance is null.
Probably, you are using primary key generation entity-command and the primary key is generated at INSERT time. If so, of course, it won't work.
As a workaround, you could use some entity-command that generates keys before INSERT.
Sorry, but that's the spec.