mirror of
https://github.com/corda/corda.git
synced 2025-06-12 20:28:18 +00:00
[CORDA-1341]: Ensure API can be called concurrently wrt transactions. (#3235)
This commit is contained in:
committed by
GitHub
parent
0f82e2df7f
commit
f68cf6f712
@ -42,7 +42,7 @@ enum class TransactionIsolationLevel {
|
||||
val jdbcValue: Int = java.sql.Connection::class.java.getField("TRANSACTION_$name").get(null) as Int
|
||||
}
|
||||
|
||||
private val _contextDatabase = ThreadLocal<CordaPersistence>()
|
||||
private val _contextDatabase = InheritableThreadLocal<CordaPersistence>()
|
||||
var contextDatabase: CordaPersistence
|
||||
get() = _contextDatabase.get() ?: error("Was expecting to find CordaPersistence set on current thread: ${Strand.currentStrand()}")
|
||||
set(database) = _contextDatabase.set(database)
|
||||
|
Reference in New Issue
Block a user