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.0407231713100.27383-100000@willy
Whole thread Raw
In response to Re: conflict txns in serialization isolation  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: conflict txns in serialization isolation
List pgsql-jdbc
> I kinda suspect that you are getting confused by JDBC autocommit
> behavior and are having transactions commit when you thought they
> were still open.  But without a complete example it's only speculation.
>
> Your first gripe might also be explained by supposing that the
> transactions are actually in read committed mode, and not serializable
> mode at all.

I realized those potential problems and in my codes:

db = DriverManager.getConnection(url, username, password);
db.setAutoCommit(false);
db.setTransactionIsolation(java.sql.Connection.TRANSACTION_SERIALIZABLE);

Even in Read-Committed isolation level, if version check is performed(as I
suppose postgresql7.2 will always do), one of concurrent conflicting txns
will be aborted. Read-committed is different from Snapshot in that
Read-Committed txn will read data committed before read operation starts
but snapshot txn will read data committed before the whole txn starts.

Do I correctly understand how postgresql7.2 works?

Regards,

Yi


pgsql-jdbc by date:

Previous
From: Tom Lane
Date:
Subject: Re: conflict txns in serialization isolation
Next
From: Tom Lane
Date:
Subject: Re: conflict txns in serialization isolation