FINERACT-2081: Consider read-only all the transactions when the connection is read-only

This commit is contained in:
Adam Saghy
2024-12-12 17:43:31 +01:00
parent d57906d4fa
commit 5667bc89be
2 changed files with 14 additions and 6 deletions
@@ -70,10 +70,8 @@ public class TomcatJdbcDataSourcePerTenantService implements RoutingDataSourceSe
Long tenantConnectionKey = tenantConnection.getConnectionId();
// if tenantConnection information available switch to the
// appropriate datasource for that tenant.
actualDataSource = TENANT_TO_DATA_SOURCE_MAP.computeIfAbsent(tenantConnectionKey, (key) -> {
DataSource tenantSpecificDataSource = dataSourcePerTenantServiceFactory.createNewDataSourceFor(tenantConnection);
return tenantSpecificDataSource;
});
actualDataSource = TENANT_TO_DATA_SOURCE_MAP.computeIfAbsent(tenantConnectionKey,
(key) -> dataSourcePerTenantServiceFactory.createNewDataSourceFor(tenantConnection));
}