-
1. Re: i cant set relations - can somebody help?
sweetfa Sep 15, 2002 6:58 PM (in response to brecicure)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... -
2. Re: i cant set relations - can somebody help?
catriona Sep 16, 2002 6:50 AM (in response to brecicure)Hi
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.
Thanks
C -
3. Re: i cant set relations - can somebody help?
brendelk Sep 17, 2002 1:31 PM (in response to brecicure)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',
NULL, NULL)]
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. -
4. Re: i cant set relations - can somebody help?
fsaint Sep 17, 2002 6:06 PM (in response to brecicure)I found the same problem in jboss-3.0.0+tomcat, using jboss-3.0.3RC1 fixed the problem.
-
5. Re: i cant set relations - can somebody help?
dsundstrom Sep 17, 2002 6:25 PM (in response to brecicure)Yep, I fixed this a couple of weeks ago.
-
6. Re: i cant set relations - can somebody help?
cosmic_crusader Sep 18, 2002 3:39 AM (in response to brecicure)> 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? -
7. Re: i cant set relations - can somebody help?
dsundstrom Sep 19, 2002 2:38 PM (in response to brecicure)This is an old bug. Are you using JBoss 3.0.2 or newer?