Re: conflict txns in serialization isolation - Mailing list pgsql-jdbc

From Yi LIN
Subject Re: conflict txns in serialization isolation
Date
Msg-id Pine.GSO.4.44.0407261347370.29092-100000@willy
Whole thread Raw
In response to Re: conflict txns in serialization isolation  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
Hi Kris:

> > db = DriverManager.getConnection(url, username, password);
> > db.setAutoCommit(false);
> > db.setTransactionIsolation(java.sql.Connection.TRANSACTION_SERIALIZABLE);
> >
>
> I think you want to set the transaction isolation before starting the
> transaction by turning off autocommit.  Later versions of the driver make
> this work correctly or throw an error on this situation, but I recall you
> were using an old version.  So try reordering the last two lines.

Now it works correctly as psql. Thanks a lot!

Yi Lin


pgsql-jdbc by date:

Previous
From: Tom Lane
Date:
Subject: Re: Problem w/ IDENT authentication
Next
From: Ian Pilcher
Date:
Subject: Re: Problem w/ IDENT authentication