Thank you Bernhard for this information.

I believe this is relevant to Middlegen, which I believe you have already
tried. More specifically to
http://boss.bekk.no/boss/middlegen/plugins/cmp20.html#fkcmp

Do you know if there is a bug report on this FK issue that I could watch?

Cheers,
Aslak

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:xdoclet-user-admin@;lists.sourceforge.net]On Behalf Of
> Meyer-Willner, Bernhard
> Sent: 22. oktober 2002 09:37
> To: Xdoclet-User (E-Mail)
> Subject: [Xdoclet-user] CMR with JBoss and FK NOT NULL constraints in
> database
>
>
> Hi,
>
> I'm a heavy XDoclet and JBoss user and lover, and although this is an
> XDoclet mailing list I think this will be of interest to some
> people like me
> who use XDoclet together with JBoss.
>
> A few days ago I posted some messages regarding the topic of setting CMR
> relationships and FK NOT NULL constraints in the corresponding DB tables
> (unfortunately I didn't get any replies). Anyways, first I thought XDoclet
> was generating crap somehow, but sure enough it wasn't. By doing some
> research in the JBoss forums I found it's a bug in JBoss,
> JBossCMP - its CMP
> engine - to be exact which is supposed to be fixed by version 3.1
> (we're are
> 3.0.3 now). This comes from Dain Sundstrom, chief developer of JBossCMP.
>
> Problem with JBoss is: Right now it's not capable (WebLogic supposedly is)
> to defer committing the insert statement for ejbCreate/ejbPostCreate until
> the end of ejbPostCreate. This means if you call ejbCreate on an
> entity bean
> which has relationships with other beans and the FK columns by which these
> relationships are mapped are declared NOT NULL in the DB, you get
> a NOT NULL
> constraint violation from your DB telling you the FK field has to have a
> value. Of course, the FK field is only filled after setting the
> CMR field in
> your entity bean. For JBoss, however, this is too late if done
> ejbPostCreate. By this time you will already have received your
> CreateException caused by the DB. All this creates a dilemma,
> since to make
> JBoss happy the CMR field should be set in ejbCreate, of course this is
> disallowed, rightfully so, by the EJB spec and JBoss doesn't like this
> either.
>
> Well, by now you already know that I like writing novels, but to
> make a long
> story short: This is a bug in JBoss which will hopefully be fixed
> soon. For
> now the only workaround is to disable or remove those NOT NULL constraints
> in your DB. I guess some DBA's will hate you for that but there's no other
> choice.
>
> Another thing in this regard: I saw in the new XDoclet docs that it's
> recommended as a best practice to call the setXXXValue() method for a bean
> in ejbPostCreate. I think this is a good idea which I would like
> to follow.
> Unfortunately, JBoss won't allow this at the moment.
>
> Regards
> Bernhard
>
> ---
> Bernhard Meyer-Willner
>
> Insurance - Financial Services
> Logica GmbH
> Alster City
> Osterbekstrasse 90b
> 22083 Hamburg (Germany)
> (+49) 40-27071-405
> (+49) 177-425-9036
> mailto:Meyer-WillnerB@;logica.com
> www.logica.com/de
>
>
>
>
> This e-mail and any attachment is for authorised use by the
> intended recipient(s) only.  It may contain proprietary material,
> confidential information and/or be subject to legal privilege.
> It should not be copied, disclosed to, retained or used by, any
> other party.  If you are not an intended recipient then please
> promptly delete this e-mail and any attachment and all copies and
> inform the sender.  Thank you.
>
>
> -------------------------------------------------------
> This sf.net emial is sponsored by: Influence the future of
> Java(TM) technology. Join the Java Community Process(SM) (JCP(SM))
> program now. http://ad.doubleclick.net/clk;4699841;7576301;v?
> http://www.sun.com/javavote
> _______________________________________________
> Xdoclet-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-user



-------------------------------------------------------
This sf.net emial is sponsored by: Influence the future of 
Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) 
program now. http://ad.doubleclick.net/clk;4699841;7576301;v?
http://www.sun.com/javavote
_______________________________________________
middlegen-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/middlegen-user

Reply via email to