Skip to content

Commit

Permalink
Remove transactions from StatManager read operations.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dries Samyn committed Jan 9, 2024
1 parent 818bcae commit 06abd7e
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class StateManagerImpl(
return if (keys.isEmpty()) {
emptyMap()
} else {
dataSource.connection.transaction { connection ->
dataSource.connection.use { connection ->
stateRepository.get(connection, keys)
}.map {
it.fromPersistentEntity()
Expand Down Expand Up @@ -137,7 +137,7 @@ class StateManagerImpl(
return if (filters.isEmpty()) {
emptyMap()
} else {
dataSource.connection.transaction { connection ->
dataSource.connection.use { connection ->
stateRepository.filterByAll(connection, filters)
}.map {
it.fromPersistentEntity()
Expand All @@ -151,7 +151,7 @@ class StateManagerImpl(
return if (filters.isEmpty()) {
emptyMap()
} else {
dataSource.connection.transaction { connection ->
dataSource.connection.use { connection ->
stateRepository.filterByAny(connection, filters)
}.map {
it.fromPersistentEntity()
Expand All @@ -165,7 +165,7 @@ class StateManagerImpl(
intervalFilter: IntervalFilter,
metadataFilters: Collection<MetadataFilter>
): Map<String, State> {
return dataSource.connection.transaction { connection ->
return dataSource.connection.use { connection ->
stateRepository.filterByUpdatedBetweenWithMetadataMatchingAll(connection, intervalFilter, metadataFilters)
}.map {
it.fromPersistentEntity()
Expand All @@ -178,7 +178,7 @@ class StateManagerImpl(
intervalFilter: IntervalFilter,
metadataFilters: Collection<MetadataFilter>
): Map<String, State> {
return dataSource.connection.transaction { connection ->
return dataSource.connection.use { connection ->
stateRepository.filterByUpdatedBetweenWithMetadataMatchingAny(connection, intervalFilter, metadataFilters)
}.map {
it.fromPersistentEntity()
Expand Down

0 comments on commit 06abd7e

Please sign in to comment.