CordaPersistence class minor refactoring to align with Enterprise repo. (#4012)

This commit is contained in:
szymonsztuka 2018-10-02 16:49:31 +01:00 committed by GitHub
parent 6f05f639fb
commit bc6ef74c6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,8 @@ enum class TransactionIsolationLevel {
/**
* The JDBC constant value of the same name but prefixed with TRANSACTION_ defined in [java.sql.Connection].
*/
val jdbcValue: Int = java.sql.Connection::class.java.getField("TRANSACTION_$name").get(null) as Int
val jdbcString = "TRANSACTION_$name"
val jdbcValue: Int = java.sql.Connection::class.java.getField(jdbcString).get(null) as Int
}
private val _contextDatabase = InheritableThreadLocal<CordaPersistence>()
@ -63,6 +64,7 @@ class CordaPersistence(
HibernateConfiguration(schemas, databaseConfig, attributeConverters, jdbcUrl)
}
}
val entityManagerFactory get() = hibernateConfig.sessionFactoryForRegisteredSchemas
data class Boundary(val txId: UUID, val success: Boolean)