Hi!
In our application we're using CMP beans with inheritance. We develop in VAJ 3.5 and deploy to WAS 3.5.5. Our DBMS is DB2 for OS/390.
When we try to create an instance of one of the leaf CMP beans we encounter some really strange behavior (at least in some cases, described in detail below):
1) If we perform the operation right after WAS has been started, DB2 throws an exception saying that it's not possible to insert NULL into a not NULL column, even though our traces show that a proper value is propagated to the bean.
2) If we create another CMP bean first, and then try to create the "strange bean", everything works fine, except for the fact that the value inserted in the column DB2 complained about (described above) is always the same value as for the object we inserted just before this one!!
3) Our traces show some differences between ejbCreate in our normal, fine working beans and the strange bean. our code looks just the same:
In the Super Bean:
public void ejbCreate(IntressentEVO evo){
_initLinks();
// All CMP fields should be initialized here.
Trace.info(this,"create", "Entering Intressent.ejbCreate");
this.intressentnr = evo.getIntressentnr();
this.andradHandl = evo.getAndradHandl();
//... more code...
Trace.info(this,"create", "Leaving Intressent.ejbCreate");
}
And in the strange bean:
public void ejbCreate(FysiskPersonEVO evo) throws javax.ejb.CreateException, java.rmi.RemoteException {
Trace.info(this,"create", "FysiskPerson create before super.ejbCreate");
super.ejbCreate(evo);
Trace.info(this,"create", "FysiskPerson create Entity bean after super.ejbCreate");
this.datumFulltArbetsfor = evo.getDatumFulltArbetsfor();
this.datumDodsfall = evo.getDatumDodsfall();
Trace.info(this,"create", "Leaving FysiskPerson.ejbCreate");
}
The We have also put traces in the generated EJSJDBCPersisterXXX classes.
The normal trace (in another bean called EnskildFirma) when creating an instance looks like this:
"Enskild Firma create before super.ejbCreate"
"Entering Intressent.ejbCreate"
"Leaving Intressent.ejbCreate"
"EnskildFirma create Entity bean after super.ejbCreate"
"Leaving FysiskPerson.ejbCreate"
"EJSJDBCPersistenceEnskildFirma..."
But when invoking ejbCfreate in FysiskPersonBean, it looks like this:
"Entering Intressent.ejbCreate"
"Leaving Intressent.ejbCreate"
"EJSJDBCPersistenceFysiskPerson..."
4) At last but not least. This behavior only appears in WAS. When we test this locally in WTE in VAJ everything works fine, traces looks fine and proper objects are created in DB2.
And yes, we have verified (a couple of times) that it is the same code in VAJ and WAS.
I don't expect that anyone has encountered exatly the same problems as we, but anything that could lead to some clues of what is wrong would be appreciated.
//Johan