grnet/synnefo — pull request #157 by papagian (2014-07-17 13:48:24+00:00)
Title: pithos: Recover from DB integrity errors

In Pithos+ atomicity is forced on the container level.
Hence, write operations in the account level can produce integrity errors.

This commit handles these cases.

In PostgreSQL, a transaction is aborted (and all the subsequent commands are ignored)
if an integrity error occurs.

Therefore, before performing an command that can produce an integrity error,
a new savepoint is defined inside the transaction,
and after the command execution, is rollbacked or committed
according to execution status.