Forum OpenACS Q&A: Re: PostgreSQL MVCC transaction model

Collapse
Posted by russ m on
I am not sure what you do if you need to do dml that uses a consistent dataset (other than just lock everything in sight).

Jeff - you either use the "SELECT ... FOR UPDATE" form of SELECT (which locks the rows SELECTed until the end of the transaction), or you "SET TRANSACTION ISOLATION LEVEL SERIALIZABLE". Neither option is a perfect solution - the first can potentially block writers if they're trying to update a row that has been SELECTed FOR UPDATE, and the second may abort your transaction if inconsistent updates occur at the same time.