Infobip Spring Data Querydsl provides new functionality that enables the user to leverage the full power of Querydsl API on top of Spring Data repository infrastructure.
createQuery() of SimpleQuerydslR2dbcFragment returns new TransactionalRowsFetchSpec<>(databaseClient.sql(sql).map(mapper), TransactionalOperator.create(reactiveTransactionManager));.
This makes any query using this method are executed with a transaction even when it is just select query which doesn't needs transaction practically.
Also, it uses TransactionalOperator.create(reactiveTransactionManager) which executes TransactionDefinition.withDefaults() inside. So, transactionDefinition made by outer scope can be ignored.
Did I miss something? If so, please let me know how I use this awesome library correctly.
If these operations are intended, could you explain the reason?
Hm, I don't recall anymore why transaction was created manually there but since tests pass without transaction operator, I'll assume it's safe to remove.
createQuery()
ofSimpleQuerydslR2dbcFragment
returnsnew TransactionalRowsFetchSpec<>(databaseClient.sql(sql).map(mapper), TransactionalOperator.create(reactiveTransactionManager));
.This makes any query using this method are executed with a transaction even when it is just
select
query which doesn't needs transaction practically.Also, it uses
TransactionalOperator.create(reactiveTransactionManager)
which executesTransactionDefinition.withDefaults()
inside. So, transactionDefinition made by outer scope can be ignored.Did I miss something? If so, please let me know how I use this awesome library correctly. If these operations are intended, could you explain the reason?