CORDA-1548 Hibernate session not flushed before handing over raw JDBC session to user code (e.g. coin selection) (#3266)

* Hibernate session flushed before handing over raw JDBC session to user code + test - inserting and selecting cash in the same transaction
* Additional two tests copied from Enterprise repo
This commit is contained in:
szymonsztuka
2018-05-30 16:19:06 +01:00
committed by GitHub
parent 9418f9191e
commit ed70fea3a7
2 changed files with 102 additions and 0 deletions

View File

@ -105,6 +105,7 @@ class CordaPersistence(
fun createSession(): Connection {
// We need to set the database for the current [Thread] or [Fiber] here as some tests share threads across databases.
_contextDatabase.set(this)
currentDBSession().flush()
return contextTransaction.connection
}