Project

General

Profile

Revision 4d18f3c4

ID4d18f3c4e4495432841725cffbfeec9fe348fd35
Parent ca8969f2
Child 923fd553

Added by Andreas Kohlbecker 9 months ago

ref #7900 read-only transactions in DTO service with Propagation.REQUIRES_NEW

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/registration/IRegistrationWorkingSetService.java
83 83
     * @param propertyPaths
84 84
     * @return
85 85
     */
86
    Pager<RegistrationDTO> findInTaxonGraph(UUID submitterUuid, Collection<RegistrationStatus> includedStatus,
86
    public Pager<RegistrationDTO> findInTaxonGraph(UUID submitterUuid, Collection<RegistrationStatus> includedStatus,
87 87
            String taxonNameFilterPattern, MatchMode matchMode, Integer pageSize, Integer pageIndex,
88 88
            List<OrderHint> orderHints);
89 89

  
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/registration/RegistrationWorkingSetService.java
23 23
import org.springframework.beans.factory.annotation.Autowired;
24 24
import org.springframework.beans.factory.annotation.Qualifier;
25 25
import org.springframework.stereotype.Service;
26
import org.springframework.transaction.annotation.Propagation;
26 27
import org.springframework.transaction.annotation.Transactional;
27 28

  
28 29
import eu.etaxonomy.cdm.api.application.CdmRepository;
......
57 58
 *
58 59
 */
59 60
@Service("registrationWorkingSetService")
60
@Transactional(readOnly=true)
61
@Transactional(readOnly=true, propagation=Propagation.REQUIRES_NEW)
61 62
public class RegistrationWorkingSetService implements IRegistrationWorkingSetService {
62 63

  
63 64
    public static final List<String> REGISTRATION_DTO_INIT_STRATEGY = Arrays.asList(new String []{
......
170 171
     * @return
171 172
     */
172 173
    @Override
173
    @Transactional(readOnly=true)
174 174
    public RegistrationDTO loadDtoByUuid(UUID uuid) {
175 175
        Registration reg = repo.getRegistrationService().load(uuid, REGISTRATION_DTO_INIT_STRATEGY);
176 176
        inititializeSpecimen(reg);
......
178 178
    }
179 179

  
180 180
    @Override
181
    @Transactional(readOnly=true)
182 181
    public Pager<RegistrationDTO> pageDTOs(String identifier, Integer pageIndex,  Integer pageSize) throws IOException {
183 182

  
184 183
        Pager<Registration> regPager = repo.getRegistrationService().pageByIdentifier(identifier, pageIndex, pageSize, REGISTRATION_DTO_INIT_STRATEGY);
......
258 257
    }
259 258

  
260 259
    @Override
261
    @Transactional(readOnly = true)
262 260
    public Pager<RegistrationDTO> findInTaxonGraph(UUID submitterUuid, Collection<RegistrationStatus> includedStatus,
263 261
            String taxonNameFilterPattern, MatchMode matchMode,
264 262
            Integer pageSize, Integer pageIndex, List<OrderHint> orderHints) {
......
370 368
    /**
371 369
     * @param regs
372 370
     */
373
    public void initializeSpecimens(List<Registration> regs) {
371
    private void initializeSpecimens(List<Registration> regs) {
374 372
        for(Registration reg : regs){
375 373
            inititializeSpecimen(reg);
376 374
        }
......
381 379
    /**
382 380
     * @param reg
383 381
     */
384
    public void inititializeSpecimen(Registration reg) {
382
    private void inititializeSpecimen(Registration reg) {
385 383

  
386 384
        for(TypeDesignationBase<?> td : reg.getTypeDesignations()){
387 385
            if(td instanceof SpecimenTypeDesignation){

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)