ejbPostCreate is being called OK.
Do you have the correct multiplicity in your relationship definition.
If you have am multiplicity of 1-1 you may find problems with it only setting one, and the rest remaining blank...
I am having this problem also. I have two CMP2.x Entity beans with a many to many relationship. When I create a relation by calling the setXXX on one of my entity beans after creation, it does not put any data into the relation table. It does not throw any errors and I have no idea why this is happeneing.
I would be very grateful if anybody has had this problem before and has any advice.
I think my problem is related to this. I have foreign keys and constarints for them. When ejbCreate is called I have an exception in JBoss:
INFO [jbossweb] ActionServlet: Create error: javax.ejb.CreateException:
Could not create entity:java.sql.SQLException: Try to insert null into a
non-nullable column in statement [INSERT INTO RESERVATIONS (reservation_id,
person_id_fk, flight_id_fk, registration_utc, comment, person_id_fk,
flight_id_fk) VALUES (5, 5, 5, '2002-11-11 11:11:11.0', 'jgkgjgh',
Draw attention that person_id_fk, flight_id_fk repeated two times. Last time it is overwriten by null values. And due to fields are not null exception is thrown.
I found the same problem in jboss-3.0.0+tomcat, using jboss-3.0.3RC1 fixed the problem.
Yep, I fixed this a couple of weeks ago.
> ejbPostCreate is being called OK.
> Do you have the correct multiplicity in your
> relationship definition.
> If you have am multiplicity of 1-1 you may find
> problems with it only setting one, and the rest
> remaining blank...
I too am experiencing this problem of a 1-1 relationship not being set on the ejbPostCreate().
The method gets called without incident, but the database does not reflect it?
However if I call the setter method after the creation (on the Local interface) then it works fine. However I woudl prefer not to expose the setter method and have it set in creation only.
(Oh and just to cover all the bases I tried calling the setter method in the ejbPostCreate when the setter method was on the local interface but it made no difference).
Is this a bug or valid behaviour?
This is an old bug. Are you using JBoss 3.0.2 or newer?