Unanswered: integrity constraint problem when there should be none
I am facing a weird problem inserting records.
I get the following exception:
java.sql.SQLException: ORA-02291: integrity constraint (SW_ADMIN.SYS_C0025227) violated - parent key not found error.
I am using Oracle 18.104.22.168 and ojdbc14_g JDBC Driver provided with Oracle 10. (JDK 1.4.1)
This error should not be happening as there are no integrity constraints being violated. This error is not consistent (in the sense simillar inserts are working at few places but are not working at few other places). ALSO this error is not occuring when we use a third party JDBC Driver (DataDirect).
the scenario is
CREATE TABLE A (
PRIMARY KEY (a_column1)
The above code fails for the 2nd Insert statement for
With error ORA-02291: integrity constraint
***** BUT if we changes it to
ps3.setString("" + a_pk);
IT works fine.
With the datadirect JDBC Driver we dont need the above modification IT works fine.
ONLY With the ojdbc driver that comes along with Oracle9i we see this problem.
The most weired part is it is always not the case, the exact similar code works fine for some tables but doesn't work for few other tables.
Can someone let me know what might be the problem and what would be a fix for this.