Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Commit 949cc6c

Browse files
committed
wrapped the service later (ResourceService.getById()) in a read-only
transaction to insure rollback happens in a contained way. This enables the migration of all <IdentifiedObject T> getById() to now be refactored into the implementation.
1 parent c2ff1d1 commit 949cc6c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/main/java/org/energyos/espi/common/service/impl/ResourceServiceImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.springframework.beans.factory.annotation.Autowired;
1111
import org.springframework.dao.EmptyResultDataAccessException;
1212
import org.springframework.stereotype.Service;
13+
import org.springframework.transaction.annotation.Transactional;
1314

1415
import java.util.ArrayList;
1516
import java.util.List;
@@ -56,6 +57,7 @@ public <T> T findByUUID(UUID uuid, Class<T> clazz) {
5657
}
5758

5859
@Override
60+
@Transactional( readOnly = true)
5961
public <T extends IdentifiedObject> T findById(Long id, Class<T> clazz) {
6062
return repository.findById(id, clazz);
6163
}

0 commit comments

Comments
 (0)