I think I solve this, pelase see details of what I did... Investigations: Initial investigation suggests that the cause of the error is either of the following: 1. The passed foreign key is null. In this case, EKU_ID is said to be null. - Immediate resolution is to trace through the code to check if the EKU_id field contains value. It was found out the the object has the EKU value 2. There could be missing JBOSS configurations such as in the standardjbosscmp-jdbc.xml - extended logging facility to check where exact error occurs 3. There could be missing tag elements in the descriptor files: JBOSSCMP-JDBC.xml, EJB-JAR.xml, JBOSS.xml a. JBOSSCMP-JDBC.xml: - checked "org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCOracleCreateCommand" for creation of sequence - checked usage of optimistic-locking since there is a table relationship - checked usage of <ejb-relation>, might have missed JBOSS-required element tag - checked usage of <cmp-field> b. EJB-JAR.xml - checked usage of <resource-ref> - usage of fields c. JBOSS.xml - added <insert-after-ejb-post-create>true</insert-after-ejb-post-create> since initially, ejbPostCreate() is not called in the code. The ejbPostCreate() should handle setting of CMR fields - added use of resource managers 4. Checking code implementation of setting the CMP and CMR fields - the CMP fields should be set in the ejbCreate() methods and the CMR fields (eg setKunde()) should be set in the ejbPostCreate() - tried moving the CMR calls inside the ejbCreate() methods causes a TransactionRollbackException() 5. Understanding how the container manages insertion of data, the insert SQL script is automatically generated after the ejbCreate() method
Resolution: 1. Creating a simple application with two tables (with relationships) deployed and runnable in JBOSS. The sample application however does not use foreign key constraints 2. Tried removing the foreign key constraints from the KSO database/schema (eg. EKU_ID). 3. Checked Frankfurt schema (SD12) and found out that there are no foreign key constraints implemented (see attached image) 4. Tried setting the foreign key constraints as "Nullable". Currently, is it set to "Not Nullable" 5. Furthermore, checking the JBOSS CMP 2 documentation (attached page 85-86) it was stated that all foreign key fields must ALWAYS be set to nullable. My question now, if it is really confirmed that foreign fields should always be nullable? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3930405#3930405 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3930405 ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ JBoss-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jboss-user
