Re: How to get rid of NOTICE:

From: Barry Lind <blind(at)xythos(dot)com>
To: szilva(at)computer(dot)org
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: How to get rid of NOTICE:
Date: 2003-09-19 17:05:14
Message-ID: 3F6B374A.8020406@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

NOTICEs are treated as SQLWarnings by the jdbc driver.

Generally this error means that you had a previous error and tried
continuing to use that connection without first calling rollback() on
the connection. Do you have logic that traps SQLExceptions and then
continues without doing a rollback() first?

--Barry

szilva(at)computer(dot)org wrote:
> Dear All,
>
> Using pg 7.3.4, Sun jvm 1.4.1_02 and either pg73jdbc3.jar or
> pg73jdbc2.jar on Linux Debian Woody I experiencing some problems when
> creating a table via JDBC.
>
> This statement: CREATE TABLE testtable(
> cd_id serial NOT NULL PRIMARY KEY,
> cd_structure BYTEA NOT NULL,
> cd_smiles VARCHAR(1000) NULL,
> cd_formula VARCHAR(100) NULL,
> cd_molweight float8 NULL,
> cd_fp1 int4 NOT NULL
> );
>
> works fine from rsql, but using JDBC I will have an error:
>
> java.sql.SQLException: ERROR: current transaction is aborted, queries
> ignored until end of transaction block
> at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:131)
>
> As far as I can see, it is because when creating the table a NOTICE will
> be printed like:
>
> NOTICE: CREATE TABLE will create implicit sequence 'asdasd_cd_id_seq' for
> SERIAL column 'asdasd.cd_id'
> NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
> 'asdasd_pkey' for table 'asdasd'
>
> that is interpreted as an exception in JDBC. Is there a way to get rid of
> this?
>
> Cheers:
> Szilva
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Nic Ferrier 2003-09-20 18:06:04 Re: Stored Procedure returns a ResultSet
Previous Message szilva 2003-09-19 16:57:29 How to get rid of NOTICE: