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.PayTempKalkulasiServiceImpl.java

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 50)
public Long getTotalPayTempKalkulasiForSalaryJournal(String searchParameter) throws Exception {
    Long totalData = payTempKalkulasiDao.getTotalPayTempKalkulasiForSalaryJournal(searchParameter)
            + payTempKalkulasiDao.getTotalPayTempKalkulasiForSalaryJournalDebetAndKredit(searchParameter);
    return totalData;
}

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

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 30)
public PayTempKalkulasi getEntityByEmpDataIdAndSpecificModelComponent(Long empDataId, Integer specific)
        throws Exception {
    return payTempKalkulasiDao.getEntityByEmpDataIdAndSpecificModelComponent(empDataId, specific);

}

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

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 30)
public List<PayTempKalkulasi> getAllDataByTotalIncomeBelow(BigDecimal nominal) throws Exception {
    return payTempKalkulasiDao.getAllDataByTotalIncomeBelow(nominal);
}

From source file:com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.HibernateRepositoryServiceImpl.java

@Transactional(propagation = Propagation.REQUIRED, readOnly = false, isolation = Isolation.READ_COMMITTED)
public void moveFolder(ExecutionContext context, final String sourceURI, final String destinationFolderURI) {

    executeWriteCallback(new DaoCallback() {
        public Object execute() {
            auditFolderCopyAndMove("moveFolder", sourceURI, destinationFolderURI);
            RepoFolder source = getFolder(sourceURI, true);
            RepoFolder dest = getFolder(destinationFolderURI, true);

            if (isAncestorOrEqual(source.getResourceURI(), dest.getResourceURI())) {
                throw new JSException("jsexception.move.folder.source.uri.ancestor.destination",
                        new Object[] { sourceURI, destinationFolderURI });
            }//from w ww.  j a va 2 s . co  m
            if (source.getParent().getResourceURI().equals(dest.getResourceURI())) {
                throw new JSException("jsexception.move.folder.to.same.folder",
                        new Object[] { sourceURI, destinationFolderURI });
            }
            if (nameExistsInFolder(dest, source.getName())) {
                throw new JSException("jsexception.move.folder.path.already.exists",
                        new Object[] { sourceURI, destinationFolderURI });
            }
            validateResourceUriLength(source.getName().length() + destinationFolderURI.length());

            if (log.isDebugEnabled()) {
                log.debug("Moving folder " + source.getResourceURI() + " to " + dest.getResourceURI());
            }

            source.moveTo(dest, HibernateRepositoryServiceImpl.this);
            closeAuditEvent("moveFolder");
            return null;
        }
    });
}

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

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 30)
public Long getTotalWorkingHourDeviation(TempAttendanceRealizationSearchParameter parameter) throws Exception {
    return empDataDao.getTotalNotTerminatePaging(parameter);
}

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

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 30)
public WorkingTimeDeviationDetailModel getEntityByEmpDataId(Long id) throws Exception {
    WorkingTimeDeviationDetailModel workingTimeDeviationDetailModel = new WorkingTimeDeviationDetailModel();
    //get Periode active
    WtPeriode wtPeriode = this.wtPeriodeDao.getEntityByAbsentTypeActive();
    EmpData empData = this.empDataDao.getByIdWithBioData(id);

    long scheduleIn = 0;
    long scheduleOut = 0;
    int marginIn = 0;
    int marginOut = 0;

    long totalHour = 0;
    long marginMinutes = 0;
    long marginHour = 0;
    long totalWorkingTime = 0;
    List<TempProcessReadFinger> listTempProcessReadFinger = tempProcessReadFingerDao.getAllDataByEmpDataId(id);
    for (TempProcessReadFinger tempProcessReadFinger : listTempProcessReadFinger) {
        //get hour from schedule in and schedule out
        scheduleIn = tempProcessReadFinger.getScheduleIn().getTime();
        scheduleOut = tempProcessReadFinger.getScheduleOut().getTime();

        //get margin in and margin out
        marginIn = tempProcessReadFinger.getMarginIn();
        marginOut = tempProcessReadFinger.getMarginOut();

        //get total from marginHour and totalHour
        marginMinutes += getTotalMargin(marginIn, marginOut);
        totalHour += getTotalHour(scheduleIn, scheduleOut);
    }/*  w  w w.j  a v  a 2  s .  c  o m*/

    marginHour = marginMinutes / 60;
    totalWorkingTime = marginHour + totalHour;
    //insert data to workingTimeDeviationDetailModel
    workingTimeDeviationDetailModel.setFromPeriod(wtPeriode.getFromPeriode());
    workingTimeDeviationDetailModel.setToPeriod(wtPeriode.getUntilPeriode());
    workingTimeDeviationDetailModel.setNikAndFullName(empData.getNik() + " "
            + empData.getBioData().getFirstName() + " " + empData.getBioData().getLastName());
    workingTimeDeviationDetailModel.setTotalWorkingTime(totalWorkingTime);
    workingTimeDeviationDetailModel.setTotalPlusMinus(marginMinutes);
    return workingTimeDeviationDetailModel;
}

From source file:com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.HibernateRepositoryServiceImpl.java

@Transactional(propagation = Propagation.REQUIRED, readOnly = false, isolation = Isolation.READ_COMMITTED)
public void moveResource(ExecutionContext context, final String sourceURI, final String destinationFolderURI) {
    executeWriteCallback(new DaoCallback() {
        public Object execute() {
            RepoResource source = findByURI(RepoResource.class, sourceURI, true);
            RepoFolder dest = getFolder(destinationFolderURI, true);

            auditResourceCopyAndMove("moveResource", sourceURI, destinationFolderURI,
                    source.getClientType().getName());
            if (source.getParent().getResourceURI().equals(dest.getResourceURI())) {
                throw new JSException("jsexception.move.resource.to.same.folder",
                        new Object[] { sourceURI, destinationFolderURI });
            }//from   w ww.  ja  v a 2s.co  m
            if (nameExistsInFolder(dest, source.getName())) {
                throw new JSException("jsexception.move.resource.path.already.exists",
                        new Object[] { sourceURI, destinationFolderURI });
            }
            if (log.isDebugEnabled()) {
                log.debug("Moving resource " + source.getResourceURI() + " to " + dest.getResourceURI());
            }

            source.moveTo(dest, HibernateRepositoryServiceImpl.this);
            closeAuditEvent("moveResource");
            return null;
        }
    });
}

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

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 50)
public List<WorkingTimeDeviationListDetailModel> getAllDataOvertimeAndReadFingerByEmpDataId(Long id,
        int firstResult, int maxResults, Order order) throws Exception {
    List<WorkingTimeDeviationListDetailModel> listModelToShow = new ArrayList<WorkingTimeDeviationListDetailModel>();
    WorkingTimeDeviationListDetailModel model;
    List<TempProcessReadFinger> listTempProcessReadFinger = tempProcessReadFingerDao
            .getAllDataOvertimeAndReadFingerByEmpDataId(id, firstResult, maxResults, order);
    int marginIn = 0;
    int marginOut = 0;
    long totalMargin = 0;
    for (TempProcessReadFinger tempProcessReadFinger : listTempProcessReadFinger) {
        //hitung kalkulasi waktu
        marginIn = tempProcessReadFinger.getMarginIn();
        marginOut = tempProcessReadFinger.getMarginOut();
        totalMargin = getTotalMargin(marginIn, marginOut);
        model = new WorkingTimeDeviationListDetailModel();
        model.setDeviationTime(totalMargin);
        model.setFingerIn(tempProcessReadFinger.getFingerIn());
        model.setFingerOut(tempProcessReadFinger.getFingerOut());
        model.setWorkingGroupName(tempProcessReadFinger.getEmpData().getWtGroupWorking().getName());
        model.setWorkingDate(tempProcessReadFinger.getScheduleDate());

        listModelToShow.add(model);//from  w w w.j  av a 2 s.com
    }
    return listModelToShow;
}

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

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 30)
public Long getTotalOvertimeAndReadFingerByEmpDataId(Long id) throws Exception {
    return tempProcessReadFingerDao.getTotalOvertimeAndReadFingerByEmpDataId(id);
}

From source file:com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.HibernateRepositoryServiceImpl.java

@Transactional(propagation = Propagation.REQUIRED, readOnly = false, isolation = Isolation.READ_COMMITTED)
public Resource copyResource(ExecutionContext context, final String sourceURI, final String destinationURI) {
    initTempNameResources();//from  ww w. j  av a  2 s .  co  m
    try {
        Resource copy = (Resource) executeWriteCallback(new DaoCallback() {
            public Object execute() {
                RepoResource repoCopy = copyResource(sourceURI, destinationURI);
                return repoCopy.toClient(resourceFactory);
            }
        });
        return copy;
    } finally {
        resetTempNameResources();
    }
}