Hi all,

I had the same problem myself, and the only workaround I found is the same as you SHA 
(declare a simple CMP field for the primary key column, setting it in ejbCreate, and 
setting the CMR field in ejbPostCreate).

To understand all this, I think that we must refer to the EJB spec.
The EJB spec says that the bean instance must have its primary key available in 
ejbPostCreate (where you can call getPrimaryKey).
JBoss conforms exactly to this point. But it is a problem when the key is generated by 
the database and some foreign keys cannot be null.

The <insert-after-ejb-post-create> set to true is useless in our case, because if you 
want to do anything in ejbPostCreate, you have an error saying that the primay key is 
null (or somthing like that). I think it works only when the container generates the 
key. 

What a shame, and there is many topics on the subject in this forum, but I never find 
a response from JBoss. I was Weblogic before, and this problem had been the worse to 
migrate (Weblogic has the same option insert-after-ejb-post-create but it works !)


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3831917#3831917

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3831917


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to