![]() ![]() As you have said it yourself, this does not work. Using the will not work because when an annotated method is called, the transaction mechanism will save the state of the transaction inside the ThreadLocal of the calling thread. ![]() Thank you Dupont for mentioning this.ĪFAIK the Spring standard transaction management does not work with WebFlux. My organization has experience with WebFlux and Cassandra, but Cassandra has a native reactive driver.ĮDIT: This answer is not valid anymore for Spring Framework version 5.2 M2 and higher. ![]() Additionally, all JDBC operations that occur within a transaction must use the same Connection which might be tough to do in a reactive context. I know Reactor has the Context object which is conceptually similar to ThreadLocal (right?) but I haven't seen any documentation that mentions that transaction makes use of it. The Spring transaction manager works by using a ThreadLocal (right?) which I'm assuming won't work in a Reactor environment, since Reactor is frugal with threads and a single thread can swap out one unit of work for another while the first is waiting on I/O. I know JDBC is inherently blocking, and thus any JDBC operations must be bridged from blocking to reactive, or vice-versa. If transaction management does work, must a method actually throw and exception, or must the Mono or Flux return type emit an error signal? Does Spring's support for RDBMS transaction management also work in Spring WebFlux?įor example, assuming proper configuration, will a method annotated with the annotation use the Spring transaction manager and rollback the transaction if an error occurs? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |