-
1. Re: allow null cmr fields
m_korotkov Apr 9, 2003 7:42 AM (in response to weiqingh)This problems exists in jboss 3.0.4 and here is the description of this issue in the standard jboss documentation on CMP.
The current implementation of JBossCMP inserts a row into the database for a new entity between ejbCreate and ejbPostCreate. Since the
EJB specification does not allow a relationship to be modified until ejbPostCreate, a foreign key will be initially set to null. There is a similar
problem with removal. This limitation will be removed in a future release.
Was it solved in 3.0.6? I'm going to try it now.
--max. -
2. Re: allow null cmr fields
weiqingh Apr 9, 2003 9:17 AM (in response to weiqingh)i tried jboss-3.2.0RC5 and it didn't work.
another part of the question is that is there a way to configure db schema so that null foreign key is allowed? -
3. Re: allow null cmr fields
m_korotkov Apr 10, 2003 6:18 AM (in response to weiqingh)I think that the only way to work around this limitation is to set nullable f. keys. I hate doing this but I don't see any other solution.
I found another problem - my application stopped working after migration from 3.0.4 to 3.2RC4. It deployes CMP beans, but at runtime on my findBy... call it throws sql exception - relation A14_users (one table in PostgreSQL 7.3) not found...
--mk. -
4. Re: allow null cmr fields
huri Apr 10, 2003 3:56 PM (in response to weiqingh)In Oracle, you can use deferred NULL constraints, which checks the constraint at commit time. Don't know if other databases have something similar.
e.g. CREATE TABLE CLIENT ( ...
STATUSID NUMBER (20) CONSTRAINT CLIENT_NN_STATUSID NOT NULL INITIALLY DEFERRED, ...