Skip to content

Commit

Permalink
Changing transaction manager's bean name back to transactionManager. (
Browse files Browse the repository at this point in the history
#20)

* Changing transaction manager's bean name back to `transactionManager`.
  • Loading branch information
onukristo authored Mar 30, 2023
1 parent 1bb8199 commit acb08a6
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.2.0] - 2023-03-30

### Changed

* `gafferJtaJtaTransactionManager` bean name to `transactionManager`.
We would like the `tw-gaffer-jta-starter` to be fully autoconfiguring the service. Unfortunately, some Spring Boot starter libraries are
specifically expecting a bean named `transactionManager`.

### Migration Guide

#### Transaction Manager Bean Name

If you were using hardcoded `gafferJtaJtaTransactionManager` bean name in your service, you have to change it now to `transactionManager`.

## [2.1.0] - 2023-02-14

### Added
Expand All @@ -14,6 +28,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

* Connection and DataSource wrappers are now implementing `tw-base-utils`'s wrapper interfaces.
* `com.transferwise.common.gaffer.jdbc.DataSourceImpl` class was renamed to `com.transferwise.common.gaffer.jdbc.GafferJtaDataSource`.

### Migration Guide

#### Auto Configuration for Gradle

It is recommended to use full autoconfiguration, which will set up the transaction manager and instrument all the data sources.

For that

1. Make sure, that all your data sources are exposed as beans.
If this is not possible, you still need to wrap those data sources into `GafferJtaDataSource`, manually.
2. Remove `tw-gaffer-jta` from `implementation` configuration.
Unless, you would need manual wrapping of `GafferJtaDataSource`.
3. Remove custom wrappings of `GafferJtaDataSource` / `DataSourceImpl`.
In Wise context, your data source beans should be just plain `HikariDataSource` instances.
4. Remove the code creating all the beans now defined in the `GafferJtaConfiguration` class.
In a typical Wise service, it comes down to deleting the whole `TransactionManagerConfiguration` class.
5. Add `tw-gaffer-jta` into `runtimeOnly` configuration.

#### Without Auto Configuration

* Change all `com.transferwise.common.gaffer.jdbc.DataSourceImpl` occurrences to `com.transferwise.common.gaffer.jdbc.GafferJtaDataSource`

## [2.0.0] - 2022-12-13

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=2.1.0
version=2.2.0
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public TransactionManager gafferJtaTransactionManager(GafferJtaProperties proper
return serviceRegistry.getTransactionManager();
}

@Bean
@Bean("transactionManager")
@ConditionalOnMissingBean
public JtaTransactionManager gafferJtaJtaTransactionManager(UserTransaction userTransaction, TransactionManager transactionManager) {
ServiceRegistry serviceRegistry = ServiceRegistryHolder.getServiceRegistry();
Expand Down

0 comments on commit acb08a6

Please sign in to comment.