PGJDBC 8 transaction problem

Поиск
Список
Период
Сортировка
От Rodrigo Willian Bonatto
Тема PGJDBC 8 transaction problem
Дата
Msg-id 54CC7CADE26E884EB2BCEC863F5C1F7001012FEC@moscou.diuno.net
обсуждение исходный текст
Ответы Re: PGJDBC 8 transaction problem  (Dave Cramer <pg@fastcrypt.com>)
Re: PGJDBC 8 transaction problem  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-jdbc

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 = DriverManager.getConnection(url, "postgres", "postgres");

conn.setAutoCommit(false);

Statement stmt = conn.createStatement();

StringBuffer query = new StringBuffer();

query.append("BEGIN;");

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

query.append("COMMIT;");

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

ResultSet rs = 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

 

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Information on JDBC driver src code, please help
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: PGJDBC 8 transaction problem