db2引用完整性问题
情况非常严重,我们在 AS400 上的 DB2 中有一个表,它定义了另一个表的外键,因此我们输入的记录具有引用表的常规 ID,因此当我们通过前端工具输入 SQL 插入时,一切都很顺利。
当此插入是通过使用 Spring 框架(仅 SQL 处理程序、Web 服务...)的 java 应用程序完成时,就会出现问题,因此事情以使用 jt400.jar 中的 jdbc 驱动程序的PreparedStatement 完成。 我们收到消息“引用完整性检查失败”,正如我们检查的那样,这是不可能的。
有人有类似的经历吗? 我们应该升级 JTOPEN 库吗? 现在已经有实际版本 6.5,我们在生产中使用 6.3,担心升级到 6.5 会产生负面影响。
忘记提及,重新启动 Tomcat(应用程序服务器)没有任何效果,但如果我重新启动 linux box(ubuntu 8.10),一切正常。 与 DB 的连接由 JNDI 管理。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许您处于事务内部,并且要放入的数据不一致,然后执行回滚,因此您不应该看到任何错误。
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.