views:

263

answers:

1

Situation is pretty serious, we have a table in DB2 on AS400 which has defined foreign key to another table, so we are entering record which have regular ID of referenced table so when we enter SQL insert through front end tool everything went fine.

Problem arises when this insert is to be done through java application which uses Spring Framework (only SQL Handler, web services...) so things finish with PreparedStatement using jdbc drivers in jt400.jar. We got message "referential integrity check failed" what is - as we checked - impossible.

Does anyoe have similar experiences? Should we upgrade JTOPEN library? Now there is actual version 6.5, we are using 6.3 in production and are affraid of negative effects of upgrading it to 6.5.

Forgot to mention, restarting Tomcat (app server) has no effect, but if I restart linux box (ubuntu 8.10) everything works fine. Connection to DB is being administered by JNDI.

A: 

Hi,

Maybe you are inside a transaction and the data you are going to put is inconsistent, and then a rollback is performed, so you should not see anytinh wrong.

ATorras
nope, this is not definitely the case. Only one operater is doing job, data in employees table is already inserted, emplyee with ID 40 is inserting new kind of document which has column OPER referencing to employee(ID) in which we tried to put number 40...
ante.sabo
Have you tried to make these updates with the JDBC connection directly?
ATorras