Definitely not covered by the spec -- the effective insert is
definitely supposed to happen between ejbCreate and ejbPostCreate.
The CMP implementation is driven by JPA so we're not really the ones
who execute the SQL. Though delaying the persist till after the
ejbPostCreate seems possible.
Dain, any ideas?
-David
On Sep 4, 2007, at 9:42 PM, Mark Aufdencamp wrote:
Hi All,
I'm still wondering about control of the SQL INSERT statement when an
EJBCreate is executed. Specifically, how can it be defined
properly to
allow the setting of CMR Relationships on Foreign Key Columns that are
defined as NOT NULL. JBoss and WebLogic both possess a container
configuration command that effectively delays the SQL INSERT until
after
the EJBPostCreate has been executed to specifically allow for this
behavior.
I've removed the NOT NULL constraint on my Database Schema, and it
functions properly with the EJBCreate setting the Primary Key, and the
EJBPostCreate setting the Foreign Key with the CMR Entity. I've
checked
to insure the MySQL tables are defined as InnoDB, so they should
support
Transaction Management. I've attempted to add the open-ejb.xml
configuration command, <enforce-foreign-key-constraints>, as suggested
by David Carew, but sadly this had no apparent effect.
Can this be done or is it an uncovered bust in the 2.1 specs?
Am I missing something maybe in the Transaction Management realm
that I
dont have configured to have this function?
Anyone engaged in the this type of Create/PostCreate with NOT NULL
Foreign Keys on a different database and JDBC driver, say Derby?
Thanks to All for suggestions,
Mark Aufdencamp
[EMAIL PROTECTED]