java - Postgresql commited data not visible -


i noticed weird behavior in application. looks commited data not visible right after commit. algorithm looks :

connection1 - insert table row id = 5 connection1 - commit, close connection2 - open connection2 - select table row id = 5 (no results) connection2 - insert table row id = 5 (primary key violation, result in db) 

if select on connection2 returns no results insert, otherwise update. server has many databases (~200), looks commit done changes in db later. use java , jdbc. ideas appreciated.

this behavior corresponds repeatable read isolation mode, see set transaction:

repeatable read
statements of current transaction can see rows committed before first query or data-modification statement executed in transaction.

try connection.settransactionisolation(connection.transaction_read_committed) see if makes difference.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -