diff --git a/ledger-service/http-json/src/itlib/scala/http/AbstractDatabaseIntegrationTest.scala b/ledger-service/http-json/src/itlib/scala/http/AbstractDatabaseIntegrationTest.scala index 0881c996422e..baf445ef9c38 100644 --- a/ledger-service/http-json/src/itlib/scala/http/AbstractDatabaseIntegrationTest.scala +++ b/ledger-service/http-json/src/itlib/scala/http/AbstractDatabaseIntegrationTest.scala @@ -187,11 +187,10 @@ abstract class AbstractDatabaseIntegrationTest extends AsyncFreeSpecLike with Be }.unsafeToFuture() "SurrogateTemplateIdCache" - { + import dao.logHandler, dao.jdbcDriver.q.queries + "should be used on template insertion and reads" in { - import dao.jdbcDriver.q.queries - def getOrElseInsertTemplate(tpid: TemplateId[String])(implicit - logHandler: LogHandler = dao.logHandler - ) = instanceUUIDLogCtx(implicit lc => + def getOrElseInsertTemplate(tpid: TemplateId[String]) = instanceUUIDLogCtx(implicit lc => dao.transact( queries .surrogateTemplateId(tpid.packageId, tpid.moduleName, tpid.entityName) @@ -212,7 +211,6 @@ abstract class AbstractDatabaseIntegrationTest extends AsyncFreeSpecLike with Be "doesn't cache uncommitted template IDs" in { import dbbackend.Queries.DBContract, spray.json.{JsObject, JsNull, JsValue}, spray.json.DefaultJsonProtocol._ - import dao.logHandler, dao.jdbcDriver.q.queries val tpId = TemplateId("pkg", "mod", "UncomCollision") diff --git a/ledger-service/http-json/src/main/scala/com/digitalasset/http/dbbackend/SupportedJdbcDriver.scala b/ledger-service/http-json/src/main/scala/com/digitalasset/http/dbbackend/SupportedJdbcDriver.scala index a6e5c9146f30..39fd3551df57 100644 --- a/ledger-service/http-json/src/main/scala/com/digitalasset/http/dbbackend/SupportedJdbcDriver.scala +++ b/ledger-service/http-json/src/main/scala/com/digitalasset/http/dbbackend/SupportedJdbcDriver.scala @@ -88,7 +88,10 @@ object SupportedJdbcDriver { // all oracle class 23 errors yield 23000; if we want to check for *unique* // violation specifically we'll have to look at something other than the SQLState. // All other class 23 errors indicate a bug, which should exhaust the retry loop anyway - retrySqlStates = Set("23000", ContractDao.StaleOffsetException.SqlState), + // likewise, class 61 covers a swath of errors for which one transaction was aborted + // in favor of continuing another [conflicting] transaction, for which retrying + // seems appropriate as well + retrySqlStates = Set("23000", "61000", ContractDao.StaleOffsetException.SqlState), ) } }