| From: | Yi LIN <ylin30(at)cs(dot)mcgill(dot)ca> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | pgsql-jdbc(at)postgresql(dot)org |
| Subject: | Re: conflict txns in serialization isolation |
| Date: | 2004-07-23 21:19:59 |
| Message-ID: | Pine.GSO.4.44.0407231713100.27383-100000@willy |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2004-07-23 21:43:43 | Re: conflict txns in serialization isolation |
| Previous Message | Tom Lane | 2004-07-23 20:26:11 | Re: conflict txns in serialization isolation |