Re: JDBC: One more autocommit use to work around

From: Barry Lind <blind(at)xythos(dot)com>
To: Fernando Nasser <fnasser(at)redhat(dot)com>
Cc: PostgreSQL jdbc list <pgsql-jdbc(at)postgresql(dot)org>, pgsql-patches(at)postgresql(dot)org
Subject: Re: JDBC: One more autocommit use to work around
Date: 2003-05-29 15:29:21
Message-ID: 3ED62751.4080406@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-patches

Fernando,

Thanks for the catch. A fix will be checked in shortly.

thanks,
--Barry

Fernando Nasser wrote:
> Last night's patch to remove uses of autocommit missed this spot.
>
> Note that here one cannot use the same strategy of ignoring the
> existence of autocommit for 7.3 as it was done on the other cases as
> someone may have configured their backend to start in SQL standard mode
> (i.e., autocommit off).
>
>
> ------------------------------------------------------------------------
>
> Index: org/postgresql/jdbc1/AbstractJdbc1Connection.java
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java,v
> retrieving revision 1.19
> diff -c -p -r1.19 AbstractJdbc1Connection.java
> *** org/postgresql/jdbc1/AbstractJdbc1Connection.java 29 May 2003 03:21:32 -0000 1.19
> --- org/postgresql/jdbc1/AbstractJdbc1Connection.java 29 May 2003 13:54:02 -0000
> *************** public abstract class AbstractJdbc1Conne
> *** 778,784 ****
> //We also set the client encoding so that the driver only needs
> //to deal with utf8. We can only do this in 7.3 because multibyte
> //support is now always included
> ! if (haveMinimumServerVersion("7.3"))
> {
> BaseResultSet acRset =
> execSQL("set client_encoding = 'UNICODE'; show autocommit");
> --- 778,784 ----
> //We also set the client encoding so that the driver only needs
> //to deal with utf8. We can only do this in 7.3 because multibyte
> //support is now always included
> ! if (haveMinimumServerVersion("7.3") && !haveMinimumServerVersion("7.4"))
> {
> BaseResultSet acRset =
> execSQL("set client_encoding = 'UNICODE'; show autocommit");
> *************** public abstract class AbstractJdbc1Conne
> *** 798,803 ****
> --- 798,813 ----
> {
> execSQL("set autocommit = on; commit;");
> }
> + }
> + // On 7.4 there is no more backend autocommit, but we still need
> + // to set the client encoding.
> + else if (haveMinimumServerVersion("7.4"))
> + {
> + BaseResultSet acRset =
> + execSQL("set client_encoding = 'UNICODE'");
> +
> + //set encoding to be unicode
> + encoding = Encoding.getEncoding("UNICODE", null);
> }
>
> // Initialise object handling

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Paul Thomas 2003-05-29 16:24:31 Re: Newbie postgres/JDBC question.
Previous Message Barry Lind 2003-05-29 15:18:50 Re: Newbie postgres/JDBC question.

Browse pgsql-patches by date

  From Date Subject
Next Message Tebaldi Mirko 2003-05-29 15:53:54 PGSQL translation to italian - Proposal n° 2
Previous Message Fernando Nasser 2003-05-29 14:03:45 JDBC: Updated LONGVARBINARY upload patch