Re: Read transactions don't work on 7.0.x db's

From: "Dave Cramer" <Dave(at)micro-automation(dot)net>
To: "'Barry Lind'" <barry(at)xythos(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Read transactions don't work on 7.0.x db's
Date: 2001-08-31 19:00:27
Message-ID: 003701c1324f$32c522b0$c201a8c0@inspiron
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-patches

Barry,

I already resent the patch. I realized the error of my patch a few
minutes ago.

The problem is: apparently you can't executeSQL("commit; begin",
getIsolationLevel()); all in one go
I had to break it into separate execSQL calls

Dave

-----Original Message-----
From: Barry Lind [mailto:barry(at)xythos(dot)com]
Sent: August 31, 2001 1:15 PM
To: Dave(at)micro-automation(dot)net
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Read transactions don't work on 7.0.x db's

Dave,

You never really explained what the problem was. What error were you
getting, and what does this fix solve?

Also, the patch you have sent reports the entire file as being changed.
That is not useful to review. Can you send a followup to the list
with a better explaination and a patch that can be more easily be
reviewed.

thanks,
--Barry

Dave Cramer wrote:
> Here's a patch to fix the problem below
>
> Dave
>
> -----Original Message-----
> From: pgsql-jdbc-owner(at)postgresql(dot)org
> [mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of Dave Cramer
> Sent: August 30, 2001 8:51 PM
> To: pgsql-jdbc(at)postgresql(dot)org
> Subject: [JDBC] Read transactions don't work on 7.0.x db's
>
>
> The following code fails on a 7.0 db, but works on a 7.1 db
>
> It works fine with the 7.0 jar, but not with the latest code
>
> I had a quick look and everything looks ok. I am going to keep looking

> but I thought I would throw this out and see if anyone knows what is
> going on
>
> Dave
>
> package test;
> import java.sql.*;
> /**
> * Title:
> * Description:
> * Copyright: Copyright (c) 2001
> * Company:
> * @author
> * @version 1.0
> */
>
> public class TransactionSelect {
>
> public TransactionSelect()
> {
> }
> public static Connection getConnection( String url, String user,
> String password)
> {
> try {
> Class.forName("org.postgresql.Driver");
> return java.sql.DriverManager.getConnection(url,user,password);
> } catch(ClassNotFoundException ex) {
> ex.printStackTrace(System.out);
> } catch(SQLException ex) {
> ex.printStackTrace(System.out);
> }
> return null;
> }
>
> public static void main(String[] args)
> {
>
> try{
> Connection con =
> getConnection("jdbc:postgresql://192.168.1.1/davec","davec","");
> if (con == null){
> throw new RuntimeException("no Connection");
> }
> con.setAutoCommit(false);
> PreparedStatement pstmt = con.prepareStatement("select * from
> categories" );
> ResultSet rs = pstmt.executeQuery();
> con.commit();
> con.close();
> }catch (SQLException ex){
> ex.printStackTrace(System.out);
> }
> }
> }
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>
>
> ----------------------------------------------------------------------
> --
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl
>
> Connection.patch
>
> Content-Type:
>
> application/octet-stream
> Content-Encoding:
>
> quoted-printable
>
>
> ----------------------------------------------------------------------
> --
> Part 1.3
>
> Content-Type:
>
> text/plain
> Content-Encoding:
>
> binary
>
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Mike Mascari 2001-08-31 20:11:34 Re: Regarding Vacuumdb
Previous Message Dave Cramer 2001-08-31 18:12:01 Re: Read transactions don't work on 7.0.x db's Disregard my other patch

Browse pgsql-patches by date

  From Date Subject
Next Message Dominic J. Eidson 2001-09-01 00:54:45 Re: PAM Authentication Patch, take one...
Previous Message Dave Cramer 2001-08-31 18:12:01 Re: Read transactions don't work on 7.0.x db's Disregard my other patch