Interface ChangeSetContextRunner
-
Method Summary
Modifier and TypeMethodDescriptionEagerly marks theChangeSetContextas transactional (seeChangeSetContext.markTransactional()).voidrun(Consumer<ChangeSetContext> changeSetHandler) Opens aChangeSetContextand runs the given handler within its scope.<T> Trun(Function<ChangeSetContext, T> changeSetHandler) Opens aChangeSetContextand runs the given handler within its scope.
-
Method Details
-
markTransactional
ChangeSetContextRunner markTransactional()Eagerly marks theChangeSetContextas transactional (seeChangeSetContext.markTransactional()).Transactional
ChangeSetContexts ensure to allocate transactions and corresponding resources (e.g. SQL connections), upon first interaction with a transactional data sources. Those resources are released only after closing theChangeSetContext. A transactional data source might mark theChangeSetContextas transactional, if it requires a transaction (e.g. when executing aCqnInsert,CqnUpdate,CqnDeleteorCqnSelectwith locks).ChangeSetContextthat are not marked transactional allow transactional data sources to free resources earlier, e.g. after each interaction. For example in case of JDBC data sources, SQL connections can be returned to the connection pool after executing aCqnSelectwithout locks. In that case they are not required to be kept for the entireChangeSetContextscope.Once a
ChangeSetContextis marked as transactional it can't be unmarked again.- Returns:
- the
ChangeSetContextRunner
-
run
Opens aChangeSetContextand runs the given handler within its scope. TheChangeSetContextmarks a scope in which all opened transactions etc. are committed cancelled together. Note that single transactions may fail during commit but others might be successful.The
ChangeSetContextwill be propagated to allEventContextinstances in the service call hierarchy.- Type Parameters:
T- The type of the response- Parameters:
changeSetHandler- The handler for processing the request within the context- Returns:
- A generic response object of the handler
-
run
Opens aChangeSetContextand runs the given handler within its scope. TheChangeSetContextmarks a scope in which all opened transactions etc. are committed cancelled together. Note that single transactions may fail during commit but others might be successful.The
ChangeSetContextwill be propagated to allEventContextinstances in the service call hierarchy.- Parameters:
changeSetHandler- The handler for processing the request within the context
-