X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 22E339FA2DB for ; Mon, 5 Jun 2006 10:02:59 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 09825-06 for ; Mon, 5 Jun 2006 10:02:49 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.diuno.com.br (mail.diuno.com.br [200.175.102.226]) by postgresql.org (Postfix) with ESMTP id DA4699FA111 for ; Mon, 5 Jun 2006 10:02:48 -0300 (ADT) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C688A0.2FEAD7E4" Subject: PGJDBC 8 transaction problem Date: Mon, 5 Jun 2006 10:01:40 -0300 Message-ID: <54CC7CADE26E884EB2BCEC863F5C1F7001012FEC@moscou.diuno.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: PGJDBC 8 transaction problem Thread-Index: AcaIoCytMuANEpMATwS92D9v+BiGfA== From: "Rodrigo Willian Bonatto" To: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/15 X-Sequence-Number: 15295 This is a multi-part message in MIME format. ------_=_NextPart_001_01C688A0.2FEAD7E4 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Hi, =20 I have a problem using transactions with PGJDBC 8.0 or greater. =20 For example: =20 In the database I have the following record in the "employee" table: =20 name age John 27 =20 If I use the PGJDBC 7.4 to update and list the same record in a single statement like this: =20 Class.forName("org.postgresql.Driver"); Connection conn =3D DriverManager.getConnection(url, "postgres", "postgres"); conn.setAutoCommit(false); Statement stmt =3D conn.createStatement(); StringBuffer query =3D new StringBuffer(); query.append("BEGIN;"); query.append("update employee set age =3D 28 where age =3D 27;"); query.append("COMMIT;"); query.append("select name from employee where age =3D 28"); ResultSet rs =3D stmt.executeQuery(query.toString()); =20 Here the resultset will return "John", but if I use PGJDBC driver version 8 or greater, the statement return any result. =20 Any ideas? =20 Thanks in advanced! =20 Rodrigo =20 ------_=_NextPart_001_01C688A0.2FEAD7E4 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

Hi,

 

I have a problem using transactions with = PGJDBC 8.0 or greater.

 

For example:

 

In the database I have the following record in = the “employee” table:

 

name    =             = age

John     =             = 27

 

If I use the PGJDBC 7.4 to update and list the = same record in a single statement like this:

 

Class.forName("org.postgresql.Driver"= );

Connection conn =3D = DriverManager.getConnection(url, "postgres", = "postgres");

conn.setAutoCommit(false);

Statement stmt =3D = conn.createStatement();

StringBuffer query =3D new = StringBuffer();

query.append("BEGIN;");

query.append("update employee set age =3D = 28 where age =3D 27;");

query.append("COMMIT;");

query.append("select name from employee = where age =3D 28");

ResultSet rs =3D = stmt.executeQuery(query.toString());

 

Here the resultset will return = “John”, but if I use PGJDBC driver version 8 or greater, the statement return = any result.

 

Any ideas?

 

Thanks in = advanced!

 

Rodrigo

 

------_=_NextPart_001_01C688A0.2FEAD7E4--