Thread:
Morning all, I'm having a strange problem that I'm hoping someone will be able to help me with. When preforming an insert with a failed integrity constraint the PreparedStatement.executeUpdate() method seems to hang, but works fine when the integrity is good. I would expect the method to throw an SQLException complaning about the failed contraint. The same SQL statement fails as expected with a an error message when run within psql, so I presume it's something specific to either my code, or the JDBC driver. Here is the contraint on the table in question: CONSTRAINT "$2" FOREIGN KEY (security_code) REFERENCES security (security_code) ON UPDATE RESTRICT ON DELETE RESTRICT Has anyone else noticed this occuring and/or can anyone offer any hints on where I should be looking? Cheers, Dan
Re: Strange integrity problem with PreparedStatement (sorry I forgot the subject on the last post)
From
"Daniel Washusen"
Date:
> -----Original Message----- > From: pgsql-jdbc-owner@postgresql.org > [mailto:pgsql-jdbc-owner@postgresql.org]On Behalf Of Daniel Washusen > Sent: Monday, 10 November 2003 11:57 AM > To: Postgresql JDBC > Subject: [JDBC] > > > Morning all, > I'm having a strange problem that I'm hoping someone will be able > to help me > with. > > When preforming an insert with a failed integrity constraint the > PreparedStatement.executeUpdate() method seems to hang, but works > fine when > the integrity is good. I would expect the method to throw an SQLException > complaning about the failed contraint. The same SQL statement fails as > expected with a an error message when run within psql, so I presume it's > something specific to either my code, or the JDBC driver. > > Here is the contraint on the table in question: > CONSTRAINT "$2" FOREIGN KEY (security_code) REFERENCES security > (security_code) ON UPDATE RESTRICT ON DELETE RESTRICT > > Has anyone else noticed this occuring and/or can anyone offer any hints on > where I should be looking? > > Cheers, > Dan > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html >
Daniel, Can you provide us with a test case? Dave On Sun, 2003-11-09 at 19:57, Daniel Washusen wrote: > Morning all, > I'm having a strange problem that I'm hoping someone will be able to help me > with. > > When preforming an insert with a failed integrity constraint the > PreparedStatement.executeUpdate() method seems to hang, but works fine when > the integrity is good. I would expect the method to throw an SQLException > complaning about the failed contraint. The same SQL statement fails as > expected with a an error message when run within psql, so I presume it's > something specific to either my code, or the JDBC driver. > > Here is the contraint on the table in question: > CONSTRAINT "$2" FOREIGN KEY (security_code) REFERENCES security > (security_code) ON UPDATE RESTRICT ON DELETE RESTRICT > > Has anyone else noticed this occuring and/or can anyone offer any hints on > where I should be looking? > > Cheers, > Dan > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html > >
Well, sorry for the scare. It turns out that it's something specific to the version of postgres we are running, possibly in combination with the JDBC drivers (Debian SPARC, PostgreSQL 7.3). We re-ran the tests and it's working fine on a windows machine with cygwin. Again, sorry for the scare. Cheers, Dan > -----Original Message----- > From: pgsql-jdbc-owner@postgresql.org > [mailto:pgsql-jdbc-owner@postgresql.org]On Behalf Of Dave Cramer > Sent: Monday, 10 November 2003 2:17 PM > To: Daniel Washusen > Cc: Postgresql JDBC > Subject: Re: [JDBC] > > > Daniel, > > Can you provide us with a test case? > > Dave > On Sun, 2003-11-09 at 19:57, Daniel Washusen wrote: > > Morning all, > > I'm having a strange problem that I'm hoping someone will be > able to help me > > with. > > > > When preforming an insert with a failed integrity constraint the > > PreparedStatement.executeUpdate() method seems to hang, but > works fine when > > the integrity is good. I would expect the method to throw an > SQLException > > complaning about the failed contraint. The same SQL statement fails as > > expected with a an error message when run within psql, so I presume it's > > something specific to either my code, or the JDBC driver. > > > > Here is the contraint on the table in question: > > CONSTRAINT "$2" FOREIGN KEY (security_code) REFERENCES security > > (security_code) ON UPDATE RESTRICT ON DELETE RESTRICT > > > > Has anyone else noticed this occuring and/or can anyone offer > any hints on > > where I should be looking? > > > > Cheers, > > Dan > > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 5: Have you checked our extensive FAQ? > > > > http://www.postgresql.org/docs/faqs/FAQ.html > > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings >