Browse Source

No Transactional with Supports propogation

pull/6536/head
Andrii Shvaika 4 years ago
parent
commit
7ca1f5068b
  1. 4
      dao/src/main/java/org/thingsboard/server/dao/asset/BaseAssetService.java
  2. 3
      dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsServiceImpl.java
  3. 4
      dao/src/main/java/org/thingsboard/server/dao/device/DeviceProfileServiceImpl.java
  4. 28
      dao/src/main/java/org/thingsboard/server/dao/device/DeviceServiceImpl.java
  5. 5
      dao/src/main/java/org/thingsboard/server/dao/edge/EdgeServiceImpl.java
  6. 5
      dao/src/main/java/org/thingsboard/server/dao/entityview/EntityViewServiceImpl.java
  7. 3
      dao/src/main/java/org/thingsboard/server/dao/ota/BaseOtaPackageService.java
  8. 9
      dao/src/main/java/org/thingsboard/server/dao/relation/BaseRelationService.java
  9. 3
      dao/src/main/java/org/thingsboard/server/dao/tenant/TenantProfileServiceImpl.java
  10. 1
      dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceProfileServiceTest.java

4
dao/src/main/java/org/thingsboard/server/dao/asset/BaseAssetService.java

@ -118,7 +118,6 @@ public class BaseAssetService extends AbstractCachedEntityService<AssetCacheKey,
.orElse(null), true);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public Asset saveAsset(Asset asset) {
log.trace("Executing saveAsset [{}]", asset);
@ -140,7 +139,6 @@ public class BaseAssetService extends AbstractCachedEntityService<AssetCacheKey,
return savedAsset;
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public Asset assignAssetToCustomer(TenantId tenantId, AssetId assetId, CustomerId customerId) {
Asset asset = findAssetById(tenantId, assetId);
@ -148,7 +146,6 @@ public class BaseAssetService extends AbstractCachedEntityService<AssetCacheKey,
return saveAsset(asset);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public Asset unassignAssetFromCustomer(TenantId tenantId, AssetId assetId) {
Asset asset = findAssetById(tenantId, assetId);
@ -156,7 +153,6 @@ public class BaseAssetService extends AbstractCachedEntityService<AssetCacheKey,
return saveAsset(asset);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public void deleteAsset(TenantId tenantId, AssetId assetId) {
log.trace("Executing deleteAsset [{}]", assetId);

3
dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsServiceImpl.java

@ -84,13 +84,11 @@ public class DeviceCredentialsServiceImpl extends AbstractCachedEntityService<St
false);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public DeviceCredentials updateDeviceCredentials(TenantId tenantId, DeviceCredentials deviceCredentials) {
return saveOrUpdate(tenantId, deviceCredentials);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public DeviceCredentials createDeviceCredentials(TenantId tenantId, DeviceCredentials deviceCredentials) {
return saveOrUpdate(tenantId, deviceCredentials);
@ -383,7 +381,6 @@ public class DeviceCredentialsServiceImpl extends AbstractCachedEntityService<St
}
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public void deleteDeviceCredentials(TenantId tenantId, DeviceCredentials deviceCredentials) {
log.trace("Executing deleteDeviceCredentials [{}]", deviceCredentials);

4
dao/src/main/java/org/thingsboard/server/dao/device/DeviceProfileServiceImpl.java

@ -150,7 +150,6 @@ public class DeviceProfileServiceImpl extends AbstractCachedEntityService<Device
return savedDeviceProfile;
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public void deleteDeviceProfile(TenantId tenantId, DeviceProfileId deviceProfileId) {
log.trace("Executing deleteDeviceProfile [{}]", deviceProfileId);
@ -213,7 +212,6 @@ public class DeviceProfileServiceImpl extends AbstractCachedEntityService<Device
return deviceProfile;
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public DeviceProfile createDefaultDeviceProfile(TenantId tenantId) {
log.trace("Executing createDefaultDeviceProfile tenantId [{}]", tenantId);
@ -256,7 +254,6 @@ public class DeviceProfileServiceImpl extends AbstractCachedEntityService<Device
return toDeviceProfileInfo(findDefaultDeviceProfile(tenantId));
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public boolean setDefaultDeviceProfile(TenantId tenantId, DeviceProfileId deviceProfileId) {
log.trace("Executing setDefaultDeviceProfile [{}]", deviceProfileId);
@ -283,7 +280,6 @@ public class DeviceProfileServiceImpl extends AbstractCachedEntityService<Device
return false;
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public void deleteDeviceProfilesByTenantId(TenantId tenantId) {
log.trace("Executing deleteDeviceProfilesByTenantId, tenantId [{}]", tenantId);

28
dao/src/main/java/org/thingsboard/server/dao/device/DeviceServiceImpl.java

@ -112,7 +112,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
@Autowired
private DataValidator<Device> deviceValidator;
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public DeviceInfo findDeviceInfoById(TenantId tenantId, DeviceId deviceId) {
log.trace("Executing findDeviceInfoById [{}]", deviceId);
@ -120,7 +119,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return deviceDao.findDeviceInfoById(tenantId, deviceId.getId());
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public Device findDeviceById(TenantId tenantId, DeviceId deviceId) {
log.trace("Executing findDeviceById [{}]", deviceId);
@ -147,7 +145,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
}
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public Device findDeviceByTenantIdAndName(TenantId tenantId, String name) {
log.trace("Executing findDeviceByTenantIdAndName [{}][{}]", tenantId, name);
@ -156,19 +153,16 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
() -> deviceDao.findDeviceByTenantIdAndName(tenantId.getId(), name).orElse(null), true);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public Device saveDeviceWithAccessToken(Device device, String accessToken) {
return doSaveDevice(device, accessToken, true);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public Device saveDevice(Device device, boolean doValidate) {
return doSaveDevice(device, null, doValidate);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public Device saveDevice(Device device) {
return doSaveDevice(device, null, true);
@ -340,7 +334,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public PageData<Device> findDevicesByTenantId(TenantId tenantId, PageLink pageLink) {
log.trace("Executing findDevicesByTenantId, tenantId [{}], pageLink [{}]", tenantId, pageLink);
@ -349,7 +342,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return deviceDao.findDevicesByTenantId(tenantId.getId(), pageLink);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public PageData<DeviceInfo> findDeviceInfosByTenantId(TenantId tenantId, PageLink pageLink) {
log.trace("Executing findDeviceInfosByTenantId, tenantId [{}], pageLink [{}]", tenantId, pageLink);
@ -358,7 +350,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return deviceDao.findDeviceInfosByTenantId(tenantId.getId(), pageLink);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public PageData<Device> findDevicesByTenantIdAndType(TenantId tenantId, String type, PageLink pageLink) {
log.trace("Executing findDevicesByTenantIdAndType, tenantId [{}], type [{}], pageLink [{}]", tenantId, type, pageLink);
@ -368,7 +359,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return deviceDao.findDevicesByTenantIdAndType(tenantId.getId(), type, pageLink);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public PageData<Device> findDevicesByTenantIdAndTypeAndEmptyOtaPackage(TenantId tenantId,
DeviceProfileId deviceProfileId,
@ -382,7 +372,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return deviceDao.findDevicesByTenantIdAndTypeAndEmptyOtaPackage(tenantId.getId(), deviceProfileId.getId(), type, pageLink);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public Long countDevicesByTenantIdAndDeviceProfileIdAndEmptyOtaPackage(TenantId tenantId, DeviceProfileId deviceProfileId, OtaPackageType type) {
log.trace("Executing countDevicesByTenantIdAndDeviceProfileIdAndEmptyOtaPackage, tenantId [{}], deviceProfileId [{}], type [{}]", tenantId, deviceProfileId, type);
@ -391,7 +380,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return deviceDao.countDevicesByTenantIdAndDeviceProfileIdAndEmptyOtaPackage(tenantId.getId(), deviceProfileId.getId(), type);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public PageData<DeviceInfo> findDeviceInfosByTenantIdAndType(TenantId tenantId, String type, PageLink pageLink) {
log.trace("Executing findDeviceInfosByTenantIdAndType, tenantId [{}], type [{}], pageLink [{}]", tenantId, type, pageLink);
@ -401,7 +389,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return deviceDao.findDeviceInfosByTenantIdAndType(tenantId.getId(), type, pageLink);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public PageData<DeviceInfo> findDeviceInfosByTenantIdAndDeviceProfileId(TenantId tenantId, DeviceProfileId deviceProfileId, PageLink pageLink) {
log.trace("Executing findDeviceInfosByTenantIdAndDeviceProfileId, tenantId [{}], deviceProfileId [{}], pageLink [{}]", tenantId, deviceProfileId, pageLink);
@ -411,7 +398,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return deviceDao.findDeviceInfosByTenantIdAndDeviceProfileId(tenantId.getId(), deviceProfileId.getId(), pageLink);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public ListenableFuture<List<Device>> findDevicesByTenantIdAndIdsAsync(TenantId tenantId, List<DeviceId> deviceIds) {
log.trace("Executing findDevicesByTenantIdAndIdsAsync, tenantId [{}], deviceIds [{}]", tenantId, deviceIds);
@ -428,7 +414,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
tenantDevicesRemover.removeEntities(tenantId, tenantId);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public PageData<Device> findDevicesByTenantIdAndCustomerId(TenantId tenantId, CustomerId customerId, PageLink pageLink) {
log.trace("Executing findDevicesByTenantIdAndCustomerId, tenantId [{}], customerId [{}], pageLink [{}]", tenantId, customerId, pageLink);
@ -438,7 +423,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return deviceDao.findDevicesByTenantIdAndCustomerId(tenantId.getId(), customerId.getId(), pageLink);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public PageData<DeviceInfo> findDeviceInfosByTenantIdAndCustomerId(TenantId tenantId, CustomerId customerId, PageLink pageLink) {
log.trace("Executing findDeviceInfosByTenantIdAndCustomerId, tenantId [{}], customerId [{}], pageLink [{}]", tenantId, customerId, pageLink);
@ -448,7 +432,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return deviceDao.findDeviceInfosByTenantIdAndCustomerId(tenantId.getId(), customerId.getId(), pageLink);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public PageData<Device> findDevicesByTenantIdAndCustomerIdAndType(TenantId tenantId, CustomerId customerId, String type, PageLink pageLink) {
log.trace("Executing findDevicesByTenantIdAndCustomerIdAndType, tenantId [{}], customerId [{}], type [{}], pageLink [{}]", tenantId, customerId, type, pageLink);
@ -459,7 +442,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return deviceDao.findDevicesByTenantIdAndCustomerIdAndType(tenantId.getId(), customerId.getId(), type, pageLink);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public PageData<DeviceInfo> findDeviceInfosByTenantIdAndCustomerIdAndType(TenantId tenantId, CustomerId customerId, String type, PageLink pageLink) {
log.trace("Executing findDeviceInfosByTenantIdAndCustomerIdAndType, tenantId [{}], customerId [{}], type [{}], pageLink [{}]", tenantId, customerId, type, pageLink);
@ -470,7 +452,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return deviceDao.findDeviceInfosByTenantIdAndCustomerIdAndType(tenantId.getId(), customerId.getId(), type, pageLink);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public PageData<DeviceInfo> findDeviceInfosByTenantIdAndCustomerIdAndDeviceProfileId(TenantId tenantId, CustomerId customerId, DeviceProfileId deviceProfileId, PageLink pageLink) {
log.trace("Executing findDeviceInfosByTenantIdAndCustomerIdAndDeviceProfileId, tenantId [{}], customerId [{}], deviceProfileId [{}], pageLink [{}]", tenantId, customerId, deviceProfileId, pageLink);
@ -481,7 +462,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return deviceDao.findDeviceInfosByTenantIdAndCustomerIdAndDeviceProfileId(tenantId.getId(), customerId.getId(), deviceProfileId.getId(), pageLink);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public ListenableFuture<List<Device>> findDevicesByTenantIdCustomerIdAndIdsAsync(TenantId tenantId, CustomerId customerId, List<DeviceId> deviceIds) {
log.trace("Executing findDevicesByTenantIdCustomerIdAndIdsAsync, tenantId [{}], customerId [{}], deviceIds [{}]", tenantId, customerId, deviceIds);
@ -492,7 +472,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
customerId.getId(), toUUIDs(deviceIds));
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public void unassignCustomerDevices(TenantId tenantId, CustomerId customerId) {
log.trace("Executing unassignCustomerDevices, tenantId [{}], customerId [{}]", tenantId, customerId);
@ -501,7 +480,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
customerDeviceUnasigner.removeEntities(tenantId, customerId);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public ListenableFuture<List<Device>> findDevicesByQuery(TenantId tenantId, DeviceSearchQuery query) {
ListenableFuture<List<EntityRelation>> relations = relationService.findByQuery(tenantId, query.toEntitySearchQuery());
@ -528,7 +506,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return devices;
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public ListenableFuture<List<EntitySubtype>> findDeviceTypesByTenantId(TenantId tenantId) {
log.trace("Executing findDeviceTypesByTenantId, tenantId [{}]", tenantId);
@ -623,13 +600,11 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return savedDevice;
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public PageData<UUID> findDevicesIdsByDeviceProfileTransportType(DeviceTransportType transportType, PageLink pageLink) {
return deviceDao.findDevicesIdsByDeviceProfileTransportType(transportType, pageLink);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public Device assignDeviceToEdge(TenantId tenantId, DeviceId deviceId, EdgeId edgeId) {
Device device = findDeviceById(tenantId, deviceId);
@ -649,7 +624,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return device;
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public Device unassignDeviceFromEdge(TenantId tenantId, DeviceId deviceId, EdgeId edgeId) {
Device device = findDeviceById(tenantId, deviceId);
@ -669,7 +643,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return device;
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public PageData<Device> findDevicesByTenantIdAndEdgeId(TenantId tenantId, EdgeId edgeId, PageLink pageLink) {
log.trace("Executing findDevicesByTenantIdAndEdgeId, tenantId [{}], edgeId [{}], pageLink [{}]", tenantId, edgeId, pageLink);
@ -679,7 +652,6 @@ public class DeviceServiceImpl extends AbstractCachedEntityService<DeviceCacheKe
return deviceDao.findDevicesByTenantIdAndEdgeId(tenantId.getId(), edgeId.getId(), pageLink);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public PageData<Device> findDevicesByTenantIdAndEdgeIdAndType(TenantId tenantId, EdgeId edgeId, String type, PageLink pageLink) {
log.trace("Executing findDevicesByTenantIdAndEdgeIdAndType, tenantId [{}], edgeId [{}], type [{}] pageLink [{}]", tenantId, edgeId, type, pageLink);

5
dao/src/main/java/org/thingsboard/server/dao/edge/EdgeServiceImpl.java

@ -147,7 +147,6 @@ public class EdgeServiceImpl extends AbstractCachedEntityService<EdgeCacheKey, E
return edgeDao.findByRoutingKey(tenantId.getId(), routingKey);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public Edge saveEdge(Edge edge) {
log.trace("Executing saveEdge [{}]", edge);
@ -169,7 +168,6 @@ public class EdgeServiceImpl extends AbstractCachedEntityService<EdgeCacheKey, E
}
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public Edge assignEdgeToCustomer(TenantId tenantId, EdgeId edgeId, CustomerId customerId) {
log.trace("[{}] Executing assignEdgeToCustomer [{}][{}]", tenantId, edgeId, customerId);
@ -178,7 +176,6 @@ public class EdgeServiceImpl extends AbstractCachedEntityService<EdgeCacheKey, E
return saveEdge(edge);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public Edge unassignEdgeFromCustomer(TenantId tenantId, EdgeId edgeId) {
log.trace("[{}] Executing unassignEdgeFromCustomer [{}]", tenantId, edgeId);
@ -187,7 +184,6 @@ public class EdgeServiceImpl extends AbstractCachedEntityService<EdgeCacheKey, E
return saveEdge(edge);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public void deleteEdge(TenantId tenantId, EdgeId edgeId) {
log.trace("Executing deleteEdge [{}]", edgeId);
@ -299,7 +295,6 @@ public class EdgeServiceImpl extends AbstractCachedEntityService<EdgeCacheKey, E
customerId.getId(), toUUIDs(edgeIds));
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public void unassignCustomerEdges(TenantId tenantId, CustomerId customerId) {
log.trace("Executing unassignCustomerEdges, tenantId [{}], customerId [{}]", tenantId, customerId);

5
dao/src/main/java/org/thingsboard/server/dao/entityview/EntityViewServiceImpl.java

@ -98,7 +98,6 @@ public class EntityViewServiceImpl extends AbstractCachedEntityService<EntityVie
cache.evict(keys);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public EntityView saveEntityView(EntityView entityView) {
log.trace("Executing save entity view [{}]", entityView);
@ -108,7 +107,6 @@ public class EntityViewServiceImpl extends AbstractCachedEntityService<EntityVie
return saved;
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public EntityView assignEntityViewToCustomer(TenantId tenantId, EntityViewId entityViewId, CustomerId customerId) {
EntityView entityView = findEntityViewById(tenantId, entityViewId);
@ -116,7 +114,6 @@ public class EntityViewServiceImpl extends AbstractCachedEntityService<EntityVie
return saveEntityView(entityView);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public EntityView unassignEntityViewFromCustomer(TenantId tenantId, EntityViewId entityViewId) {
EntityView entityView = findEntityViewById(tenantId, entityViewId);
@ -124,7 +121,6 @@ public class EntityViewServiceImpl extends AbstractCachedEntityService<EntityVie
return saveEntityView(entityView);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public void unassignCustomerEntityViews(TenantId tenantId, CustomerId customerId) {
log.trace("Executing unassignCustomerEntityViews, tenantId [{}], customerId [{}]", tenantId, customerId);
@ -284,7 +280,6 @@ public class EntityViewServiceImpl extends AbstractCachedEntityService<EntityVie
EntityViewCacheValue::getEntityViews, v -> new EntityViewCacheValue(null, v), true));
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public void deleteEntityView(TenantId tenantId, EntityViewId entityViewId) {
log.trace("Executing deleteEntityView [{}]", entityViewId);

3
dao/src/main/java/org/thingsboard/server/dao/ota/BaseOtaPackageService.java

@ -69,7 +69,6 @@ public class BaseOtaPackageService extends AbstractCachedEntityService<OtaPackag
otaPackageDataCache.evict(event.getId().toString());
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public OtaPackageInfo saveOtaPackageInfo(OtaPackageInfo otaPackageInfo, boolean isUrl) {
log.trace("Executing saveOtaPackageInfo [{}]", otaPackageInfo);
@ -97,7 +96,6 @@ public class BaseOtaPackageService extends AbstractCachedEntityService<OtaPackag
}
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public OtaPackage saveOtaPackage(OtaPackage otaPackage) {
log.trace("Executing saveOtaPackage [{}]", otaPackage);
@ -191,7 +189,6 @@ public class BaseOtaPackageService extends AbstractCachedEntityService<OtaPackag
return otaPackageInfoDao.findOtaPackageInfoByTenantIdAndDeviceProfileIdAndTypeAndHasData(tenantId, deviceProfileId, otaPackageType, pageLink);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public void deleteOtaPackage(TenantId tenantId, OtaPackageId otaPackageId) {
log.trace("Executing deleteOtaPackage [{}]", otaPackageId);

9
dao/src/main/java/org/thingsboard/server/dao/relation/BaseRelationService.java

@ -96,7 +96,6 @@ public class BaseRelationService implements RelationService {
return relationDao.checkRelation(tenantId, from, to, relationType, typeGroup);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public EntityRelation getRelation(TenantId tenantId, EntityId from, EntityId to, String relationType, RelationTypeGroup typeGroup) {
log.trace("Executing EntityRelation [{}][{}][{}][{}]", from, to, relationType, typeGroup);
@ -111,7 +110,6 @@ public class BaseRelationService implements RelationService {
relations -> RelationCacheValue.builder().relation(relations).build(), false);
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public boolean saveRelation(TenantId tenantId, EntityRelation relation) {
log.trace("Executing saveRelation [{}]", relation);
@ -130,7 +128,6 @@ public class BaseRelationService implements RelationService {
return future;
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public boolean deleteRelation(TenantId tenantId, EntityRelation relation) {
log.trace("Executing DeleteRelation [{}]", relation);
@ -150,7 +147,6 @@ public class BaseRelationService implements RelationService {
return future;
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public boolean deleteRelation(TenantId tenantId, EntityId from, EntityId to, String relationType, RelationTypeGroup typeGroup) {
log.trace("Executing deleteRelation [{}][{}][{}][{}]", from, to, relationType, typeGroup);
@ -171,7 +167,6 @@ public class BaseRelationService implements RelationService {
return future;
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public void deleteEntityRelations(TenantId tenantId, EntityId entityId) {
log.trace("Executing deleteEntityRelations [{}]", entityId);
@ -269,7 +264,6 @@ public class BaseRelationService implements RelationService {
return false;
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public List<EntityRelation> findByFrom(TenantId tenantId, EntityId from, RelationTypeGroup typeGroup) {
validate(from);
@ -315,7 +309,6 @@ public class BaseRelationService implements RelationService {
}, MoreExecutors.directExecutor());
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public List<EntityRelation> findByFromAndType(TenantId tenantId, EntityId from, String relationType, RelationTypeGroup typeGroup) {
RelationCacheKey cacheKey = RelationCacheKey.builder().from(from).type(relationType).typeGroup(typeGroup).direction(EntitySearchDirection.FROM).build();
@ -334,7 +327,6 @@ public class BaseRelationService implements RelationService {
return executor.submit(() -> findByFromAndType(tenantId, from, relationType, typeGroup));
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public List<EntityRelation> findByTo(TenantId tenantId, EntityId to, RelationTypeGroup typeGroup) {
validate(to);
@ -463,7 +455,6 @@ public class BaseRelationService implements RelationService {
}, MoreExecutors.directExecutor());
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public void removeRelations(TenantId tenantId, EntityId entityId) {
log.trace("removeRelations {}", entityId);

3
dao/src/main/java/org/thingsboard/server/dao/tenant/TenantProfileServiceImpl.java

@ -81,7 +81,6 @@ public class TenantProfileServiceImpl extends AbstractCachedEntityService<Tenant
return profile == null ? null : new EntityInfo(profile.getId(), profile.getName());
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public TenantProfile saveTenantProfile(TenantId tenantId, TenantProfile tenantProfile) {
log.trace("Executing saveTenantProfile [{}]", tenantProfile);
@ -102,7 +101,6 @@ public class TenantProfileServiceImpl extends AbstractCachedEntityService<Tenant
return savedTenantProfile;
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public void deleteTenantProfile(TenantId tenantId, TenantProfileId tenantProfileId) {
log.trace("Executing deleteTenantProfile [{}]", tenantProfileId);
@ -177,7 +175,6 @@ public class TenantProfileServiceImpl extends AbstractCachedEntityService<Tenant
return tenantProfile == null ? null : new EntityInfo(tenantProfile.getId(), tenantProfile.getName());
}
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public boolean setDefaultTenantProfile(TenantId tenantId, TenantProfileId tenantProfileId) {
log.trace("Executing setDefaultTenantProfile [{}]", tenantProfileId);

1
dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceProfileServiceTest.java

@ -43,6 +43,7 @@ import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import static org.assertj.core.api.Assertions.assertThat;

Loading…
Cancel
Save