Mercurial > hg > orthanc-databases
diff Framework/PostgreSQL/PostgreSQLParameters.cpp @ 370:d2b5d9c92214 pg-transactions
PG: test feature: configurable transaction isolation level
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 22 Feb 2023 16:52:04 +0100 |
parents | 16aac0287485 |
children | 15bfd9a76f8d |
line wrap: on
line diff
--- a/Framework/PostgreSQL/PostgreSQLParameters.cpp Wed Feb 01 16:25:37 2023 +0100 +++ b/Framework/PostgreSQL/PostgreSQLParameters.cpp Wed Feb 22 16:52:04 2023 +0100 @@ -42,6 +42,8 @@ lock_ = true; maxConnectionRetries_ = 10; connectionRetryInterval_ = 5; + readWriteTransactionStatement_ = "SET TRANSACTION ISOLATION LEVEL SERIALIZABLE READ WRITE"; + readOnlyTransactionStatement_ = "SET TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY"; } @@ -96,6 +98,17 @@ maxConnectionRetries_ = configuration.GetUnsignedIntegerValue("MaximumConnectionRetries", 10); connectionRetryInterval_ = configuration.GetUnsignedIntegerValue("ConnectionRetryInterval", 5); + + if (configuration.LookupStringValue(s, "ReadWriteTransactionStatement")) + { + SetReadWriteTransactionStatement(s); + } + + if (configuration.LookupStringValue(s, "ReadOnlyTransactionStatement")) + { + SetReadOnlyTransactionStatement(s); + } + }