Example usage for org.springframework.transaction.annotation Isolation READ_COMMITTED

List of usage examples for org.springframework.transaction.annotation Isolation READ_COMMITTED

Introduction

In this page you can find the example usage for org.springframework.transaction.annotation Isolation READ_COMMITTED.

Prototype

Isolation READ_COMMITTED

To view the source code for org.springframework.transaction.annotation Isolation READ_COMMITTED.

Click Source Link

Document

A constant indicating that dirty reads are prevented; non-repeatable reads and phantom reads can occur.

Usage

From source file:com.inkubator.hrm.service.impl.EmpCareerHistoryServiceImpl.java

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 30)
public Long getTotalEmpCareerHistoryDataByParamReport(ReportEmpMutationParameter searchParameter) {
    return this.empCareerHistoryDao.getTotalEmpCareerHistoryDataByParamReport(searchParameter);
}

From source file:com.inkubator.hrm.service.impl.PasswordComplexityServiceImpl.java

@Override
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS, isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
public PasswordComplexity getByCode(String code) throws Exception {
    return this.passwordComplexityDao.getByCode(code);
}

From source file:com.inkubator.hrm.service.impl.LoginHistoryServiceImpl.java

@Override
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS, isolation = Isolation.READ_COMMITTED, timeout = 30)
public Long getToalLoginThisYear() throws Exception {
    String tahun = DateFormatter.getDateAsStringsDefaultLocale(new Date(),
            CommonUtilConstant.DEFAULT_ONLY_YEAR_FORMAT);
    Date firtsYear = null;//from  w  w w  .  j  a  v  a2s .c  o  m
    try {
        firtsYear = DateFormatter.getDateWithDefaultLocale("01-01-" + tahun,
                CommonUtilConstant.DEFAULT_DATE_SHORT_PATTERN);
    } catch (ParseException ex) {
        LOGGER.error("Error", ex);
    }
    return this.loginHistoryDao.getTotalLoginByParam(firtsYear, new Date());
}

From source file:com.inkubator.hrm.service.impl.BioSertifikasiServiceImpl.java

@Override
@Transactional(readOnly = false, isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void save(BioSertifikasi entity, UploadedFile documentFile) throws Exception {
    entity.setId(Long.parseLong(RandomNumberUtil.getRandomNumber(9)));
    BioData biodata = bioDataDao.getEntiyByPK(entity.getBioData().getId());
    OccupationType occupationType = occupationTypeDao.getEntiyByPK(entity.getOccupationType().getId());
    EducationNonFormal educationNonFormal = educationNonFormalDao
            .getEntiyByPK(entity.getEducationNonFormal().getId());

    entity.setBioData(biodata);//from ww w  .  ja v  a 2 s. co  m
    entity.setOccupationType(occupationType);
    entity.setEducationNonFormal(educationNonFormal);
    entity.setCreatedBy(UserInfoUtil.getUserName());
    entity.setCreatedOn(new Date());
    bioSertifikasiDao.save(entity);

    if (documentFile != null) {
        String uploadPath = getUploadPath(entity.getId(), documentFile);
        facesIO.transferFile(documentFile);
        File file = new File(facesIO.getPathUpload() + documentFile.getFileName());
        file.renameTo(new File(uploadPath));

        entity.setUploadPath(uploadPath);
        bioSertifikasiDao.update(entity);
    }
}

From source file:de.thm.arsnova.services.UserService.java

@Override
@Transactional(isolation = Isolation.READ_COMMITTED)
public void removeUserFromSessionBySocketId(final UUID socketId) {
    final User user = socketid2user.get(socketId);
    if (null == user) {
        LOGGER.warn("null == user for socket {}", socketId);

        return;/*from   www . j a  va 2 s . c  om*/
    }
    user2session.remove(user);
}

From source file:com.inkubator.hrm.service.impl.OhsaIncidentDocumentServiceImpl.java

@Override
@Transactional(readOnly = false, isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void save(OhsaIncidentDocument entity, UploadedFile documentFile) throws Exception {

    entity.setId(Integer.valueOf(RandomNumberUtil.getRandomNumber(6)));
    OhsaIncident ohsaIncident = ohsaIncidentDao.getEntiyByPK(entity.getOhsaIncident().getId());
    entity.setOhsaIncident(ohsaIncident);
    entity.setCreatedBy(UserInfoUtil.getUserName());
    entity.setCreatedOn(new Date());
    ohsaIncidentDocumentDao.save(entity);

    if (documentFile != null) {
        String uploadPath = getUploadPath(entity.getId(), documentFile);
        facesIO.transferFile(documentFile);
        File file = new File(facesIO.getPathUpload() + documentFile.getFileName());
        file.renameTo(new File(uploadPath));
        //documentFile.getSize();
        entity.setUploadedPath(uploadPath);
        ohsaIncidentDocumentDao.update(entity);
    }/*from  www  . j  a va2  s .co m*/
}

From source file:com.inkubator.hrm.service.impl.EmpCareerHistoryServiceImpl.java

@Override
@Transactional(readOnly = false, isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public String saveTransitionWithApproval(EmpCareerHistoryModel model) throws Exception {

    return this.saveTransition(model, Boolean.FALSE);
}

From source file:com.inkubator.hrm.service.impl.PayTempOvertimeServiceImpl.java

@Override
@Transactional(readOnly = false, isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void executeBatchFileUpload(PayTempOvertimeFileModel entity) throws Exception {
    //cek apakah data terdapat di db / tidak (tidak boleh duplikat)
    Boolean isInsertable = (payTempOvertimeDao.getAllDataByNik(entity.getNik()) != null) ? Boolean.FALSE
            : Boolean.TRUE;// ww  w. ja va  2  s.  c  o  m

    if (isInsertable) {
        PayTempOvertime payTempOvertime = new PayTempOvertime();
        payTempOvertime.setId(Long.parseLong(RandomNumberUtil.getRandomNumber(9)));
        payTempOvertime.setOvertime(entity.getOvertime());
        payTempOvertime.setEmpData(empDataDao.getEntityByNik(entity.getNik()));
        payTempOvertime.setCreatedBy(UserInfoUtil.getUserName());
        payTempOvertime.setCreatedOn(new Date());
        payTempOvertimeDao.save(payTempOvertime);
    }
}

From source file:com.inkubator.hrm.service.impl.WtScheduleShiftServiceImpl.java

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 30)
public Long getTotalWtScheduleShiftByParam(Long workingGroupId) throws Exception {
    return this.wtScheduleShiftDao.getTotalWtScheduleShiftByParam(workingGroupId);
}

From source file:com.inkubator.hrm.service.impl.EmpCareerHistoryServiceImpl.java

@Override
@Transactional(readOnly = false, isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public String saveTransitionWithRevised(EmpCareerHistoryModel model, Long approvalActivityId) throws Exception {
    String message = "error";

    /** do validation */
    this.doValidationTransition(model, approvalActivityId);

    /** proceed of revising data */
    String pendingData = this.convertToJsonData(model);
    this.revised(approvalActivityId, pendingData);

    message = "success_need_approval";

    return message;

}