Re: "No results were returned by the query" exceptions

From: Tim Lewis <tim(dot)lewis(at)hitwise(dot)com>
To: Dave(at)micro-automation(dot)net
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: "No results were returned by the query" exceptions
Date: 2002-03-20 03:48:50
Message-ID: 3C9806A1.C5298F0C@hitwise.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

No difference. Downloaded the driver
(http://jdbc.postgresql.org/download/devpgjdbc2.jar) and have had the
same problem.

It doesn't appear to have anything to do with the locking. I have had
it throw the same exception on a "select nextval ('my_sequence')" query
which doesn't make any sense at all.

The machine is running an SMP kernel with two processes accessing the
database (two database connections / driver instances etc). I have been
running the same code for about a month in development using the
previous driver with no problems. The development server was a single
processor machine running a non-SMP kernel.

Tim.

Dave Cramer wrote:

> Tim,The latest driver which is experimental doesn't throw an exception
> and I copied your lock as wellcan you try it, it is the dev driver on
> the jdbc site.let me know what else you find, if anythingDave
>
> -----Original Message-----
> From: pgsql-jdbc-owner(at)postgresql(dot)org
> [mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of Tim
> Lewis
> Sent: Tuesday, March 19, 2002 9:45 PM
> To: Dave(at)micro-automation(dot)net
> Cc: pgsql-jdbc(at)postgresql(dot)org
> Subject: Re: [JDBC] "No results were returned by the query"
> exceptions
> For what its worth Dave, there are two places in my code
> where it the exception occurs and with both of them there is
> a prior statement to lock the table in share row exclusive
> mode. ie:
>
> Statement st = db.createStatement();
> st.executeUpdate("lock table tablex in share row exclusive
> mode");
>
> String statment = "select col1 from tablex where col2 = ?";
> PreparedStatement ps = db.prepareStatement(statement);
> ps.setString(1, col2text);
> ResultSet rs = ps.executeQuery(); // <- Exception thrown
> here
>
>
> It may be coincidental but I thought it would be remiss of
> me to leave it out.
>
> Tim.
>
> Dave Cramer wrote:
>
> > Yes,
> >
> > I can confirm that it does indeed throw an exception. I
> > will have a look
> > at this shortly.
> >
> > Thanks,
> >
> > Dave
> >
> > > -----Original Message-----
> > > From: pgsql-jdbc-owner(at)postgresql(dot)org
> > > [mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of
> > Tim Lewis
> > > Sent: Tuesday, March 19, 2002 7:01 PM
> > > To: pgsql-jdbc(at)postgresql(dot)org
> > > Subject: [JDBC] "No results were returned by the query"
> > exceptions
> > >
> > >
> > > Hi people,
> > >
> > > Am I correct in assuming that the new driver now throws
> > an
> > > exception when a "No results were returned by the query"
> >
> > > occurs for a prepared sql statement. I have recently
> > > upgraded the driver from 7.1 to 7.2 and my application
> > now
> > > throws this exception when a query returns no rows in
> > the result set.
> > >
> > > Could someone clarify this with me.
> > >
> > > Thanks,
> > >
> > > Tim Lewis
> > >
> > >
> > > ---------------------------(end of
> > > broadcast)---------------------------
> > > TIP 6: Have you searched our list archives?
> > >
> > http://archives.postgresql.org
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> >
> > http://archives.postgresql.org
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Vernon Wu 2002-03-20 05:13:17 How PostgreSQL perform in a large scale, heavy loaded application?
Previous Message Dave Cramer 2002-03-20 03:01:23 Re: "No results were returned by the query" exceptions