@ Override @ Transactional ( readOnly = true , isolation = Isolation . SERIALIZABLE ) public void export ( List < EntityType > entityTypes , List < Package > packages , Path downloadFilePath , Progress progress ) { requireNonNull ( progress ) ; if ( ! ( entityTypes . isEmpty ( ) && packages . isEmpty ( ) ) ) { try ( XlsxWriter writer = XlsxWriterFactory . create ( downloadFilePath , timeZoneProvider . getSystemTimeZone ( ) ) ) { exportEmx ( entityTypes , packages , writer , progress ) ; } catch ( CodedRuntimeException e ) { throw e ; } catch ( IOException | RuntimeException e ) { throw new EmxExportException ( e ) ; } } else { throw new EmptyExportRequestException ( ) ; } }
Isolation level needs to be SERIALIZABLE in case IndexActions are being downloaded . The entities have their own transaction and can change during the download when executed with a default isolation level .