Re: conflict txns in serialization isolation

Поиск
Список
Период
Сортировка
От Yi LIN
Тема Re: conflict txns in serialization isolation
Дата
Msg-id Pine.GSO.4.44.0407231713100.27383-100000@willy
обсуждение исходный текст
Ответ на Re: conflict txns in serialization isolation  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: conflict txns in serialization isolation  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: conflict txns in serialization isolation
Следующее
От: Tom Lane
Дата:
Сообщение: Re: conflict txns in serialization isolation