gpt4 book ai didi

Spring Integration New Transactional Scope within File Poller Transaction(Spring集成文件轮询器事务中的新事务作用域)

转载 作者:bug小助手 更新时间:2023-10-25 11:59:47 25 4
gpt4 key购买 nike



We have a file poller flow bounded by pseudoTransactionManager to move / delete the input file at the end of the processing based on success or failure. While this huge file is processed, we would want to update the processing stats in DB in-between the flow multiple times, however the Jpa update is NOT committed as it is part of the file's transaction scope.

我们有一个由PassoTransactionManager限定的文件轮询器流,用于在处理结束时根据成功或失败移动/删除输入文件。在处理这个大文件时,我们希望在流之间的DB中多次更新处理统计信息,但是JPA更新并未提交,因为它是文件事务范围的一部分。


How do we define a separate independent transaction scope for the Jpa.updatingGateway? Thanks

我们如何为Jpa.updatingGateway定义单独的独立事务范围?谢谢


.handle(Jpa.updatingGateway(entityManagerFactory)
.entityClass(SomeDAO.class)
.flush(true),
ConsumerEndpointSpec::transactional)

更多回答
优秀答案推荐

Able to do via a TransactionInterceptor with reference from Spring Integration: start new transaction in my Message flow IntegrationFlowBuilder to commit change and resume the outer transaction

能够通过引用Spring Integration的TransactionInterceptor来做:在我的Message flow IntegrationFlowBuilder中启动新事务以提交更改并恢复外部事务


更多回答

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com