This commit is contained in:
Andras Slemmer
2018-04-23 13:28:34 +01:00
parent 5b4fd6fe64
commit 6bf34ed5c7
3 changed files with 3 additions and 18 deletions

View File

@ -96,7 +96,7 @@ class DBTransactionStorage(cacheSizeBytes: Long) : WritableTransactionStorage, S
override fun track(): DataFeed<List<SignedTransaction>, SignedTransaction> {
return txStorage.locked {
DataFeed(allPersisted().map { it.second.toSignedTx() }.toList(), updates.wrapWithDatabaseTransaction())
DataFeed(allPersisted().map { it.second.toSignedTx() }.toList(), updates.bufferUntilSubscribed().wrapWithDatabaseTransaction())
}
}

View File

@ -297,7 +297,6 @@ class FlowStateMachineImpl<R>(override val id: StateMachineRunId,
override fun <R : Any> suspend(ioRequest: FlowIORequest<R>, maySkipCheckpoint: Boolean): R {
val serializationContext = TransientReference(getTransientField(TransientValues::checkpointSerializationContext))
val transaction = extractThreadLocalTransaction()
val transitionExecutor = TransientReference(getTransientField(TransientValues::transitionExecutor))
parkAndSerialize { _, _ ->
logger.trace { "Suspended on $ioRequest" }
@ -312,8 +311,8 @@ class FlowStateMachineImpl<R>(override val id: StateMachineRunId,
Event.Error(throwable)
}
// We must commit the database transaction before returning from this closure, otherwise Quasar may schedule
// other fibers
// We must commit the database transaction before returning from this closure otherwise Quasar may schedule
// other fibers, so we process the event immediately
val continuation = processEventImmediately(
event,
isDbTransactionOpenOnEntry = true,