Hi,

I have following scenario : two CMP entity beans (EntityA - id (PK),
entityBId (FK in EntityB); EntityB - id (PK)) and one stateless session
bean. As a DB I use Oracle. Between EntityA and EntityB tables there is
set a normal Oracle constraint.

In one doTest() method in my session bean I do the folowing (all things
are happening in one transaction) : reassign entityB reference for one
entityA and then remove entityB that is not used anymore.

Very simplified code would look like this :
...
entityA.setEntityBId(newValueForEntityBId);
entityB.remove();
...

where, of course, entityB is the corresponding entity for old value
referrenced in entityA. In this point I get an Oracle integrity
constraint error. Looking to JAWS log I see that first JBoss tries to
delete, and after that to update (I can see this if I remove db
constraint). And, I guess, this behaviour is also normal, an
optimization issue probably, to update everything is needed at the end
of transaction, not after each setField() method invoked.
But, in this scenario, this behaviour it's not fit for me.

So, finally, question is : how can I force updates before deletes (with
db constraint on, and in one transaction) ?

I'm using : Windows NT 4.0, JDK 1.3.1, JBoss 2.2.1-Tomcat, Oracle DB.
Stack trace and source files are pretty useless for this simple
scenario.

Thank you in advance,

Remus.


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to