From a68ad8507b4b7866268e577913915796b5daeaa3 Mon Sep 17 00:00:00 2001 From: Jaco de Groot Date: Wed, 17 Apr 2024 12:51:06 +0200 Subject: [PATCH] Remove TransactionManager --- src/main/java/nl/nn/testtool/Config.java | 15 +-------------- .../storage/database/DatabaseStorage.java | 8 -------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/main/java/nl/nn/testtool/Config.java b/src/main/java/nl/nn/testtool/Config.java index f5390152..e0238780 100644 --- a/src/main/java/nl/nn/testtool/Config.java +++ b/src/main/java/nl/nn/testtool/Config.java @@ -25,13 +25,9 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Lazy; -import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Scope; import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.jdbc.datasource.SimpleDriverDataSource; -import org.springframework.transaction.TransactionManager; -import org.springframework.transaction.annotation.TransactionManagementConfigurer; import io.quarkus.arc.DefaultBean; import nl.nn.testtool.echo2.ComparePane; @@ -100,7 +96,7 @@ @Singleton @Scope("singleton") @Configuration -public class Config implements TransactionManagementConfigurer { +public class Config { @Bean @Scope("prototype") // Echo2Application needs to be unique per user (not per JVM) @@ -231,15 +227,6 @@ DataSource dataSource() { return new SimpleDriverDataSource(); } - @Bean - @Primary - @Override - public TransactionManager annotationDrivenTransactionManager() { - DataSourceTransactionManager tx = new DataSourceTransactionManager(); - tx.setDataSource(dataSource()); - return tx; - } - @Bean JdbcTemplate jdbcTemplate(DataSource dataSource) { JdbcTemplate jdbcTemplate = new JdbcTemplate(); diff --git a/src/main/java/nl/nn/testtool/storage/database/DatabaseStorage.java b/src/main/java/nl/nn/testtool/storage/database/DatabaseStorage.java index 17e6fa1e..b3e7bf9e 100644 --- a/src/main/java/nl/nn/testtool/storage/database/DatabaseStorage.java +++ b/src/main/java/nl/nn/testtool/storage/database/DatabaseStorage.java @@ -40,8 +40,6 @@ import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.PreparedStatementSetter; -import org.springframework.transaction.annotation.EnableTransactionManagement; -import org.springframework.transaction.annotation.Transactional; import lombok.Getter; import lombok.Setter; @@ -59,12 +57,6 @@ /** * @author Jaco de Groot */ -// With transaction manager configured auto-commit is disabled and PostgreSQL will not throw the following exception -// on insert of a report: org.postgresql.util.PSQLException: Large Objects may not be used in auto-commit mode. -// Without proxyTargetClass = true the test webapp will give: Bean named 'proofOfMigrationStorage' is expected to be of -// type 'nl.nn.testtool.storage.proofofmigration.ProofOfMigrationStorage' but was actually of type 'jdk.proxy3.$Proxy26' -@EnableTransactionManagement(proxyTargetClass = true) -@Transactional // @Dependent disabled for Quarkus for now because of the use of JdbcTemplate public class DatabaseStorage implements LogStorage, CrudStorage { private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());