Hello,

I am having problems with several bmp entity beans and foreign keys. I have
several beans, each bean corresponds to a table. One entity bean whose
primary key is a foreign key in several other beans is giving me problems. I
execute a remove on the the "mother" bean...and get all kinds of thrown
exceptions. The first is an SQL Exception on the removal of one row in the
project or "mother" table.

What am I doing wrong?

my tables:

create table project {
    projectid varchar(32) not null,
    userid varchar(32) not null,
    description varchar2(255),
    constraint project_pk primary key(userid,projectid)

create table material (
     materialid varchar2(32) not null,
     timestamp varchar2(19) not null,
     description varchar2(255),
     projectid varchar(32) not null,
     userid varchar(32) not null,
     constraint material_fk foreign key(projectid,userid)
              references project(projectid,userid),
     constraint material_pk primary
key(materialid,timestamp,projectid,userid));


I have an entity bean (bmp) for project and material. I have been having no
problems adding and removing projects or material entity beans with a
bean.remove() method....except when the entity bean pk for project is also
in material as a fk.

Orion throws this error when I execute a remove on a project bean which is
referenced in the material bean:

SQL Exception in remove ...

then  I get an IllegalStateException on the project entity bean...

It only goes down hill from there...

orion throws a DeadlockException in the project passivate method

then I get a MarshallingXAException error from Orion....Error while
delisting bean from TX.

Where did I go wrong?

Regards,

Lawrence




Reply via email to