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

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

Introduction

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

Prototype

Isolation REPEATABLE_READ

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

Click Source Link

Document

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

Usage

From source file:com.inkubator.sms.gateway.service.impl.RoleServiceImpl.java

@Override
@Transactional(readOnly = true, isolation = Isolation.REPEATABLE_READ, propagation = Propagation.SUPPORTS, timeout = 30)
public Role getEntiyByPK(Long l) throws Exception {
    return roleDao.getEntiyByPK(l);
}

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

@Override
@Transactional(readOnly = true, isolation = Isolation.REPEATABLE_READ, propagation = Propagation.SUPPORTS, timeout = 50)
public List<LoanType> getByParam(LoanTypeSearchParameter parameter, int firstResult, int maxResults,
        Order orderable) {/*from  w  w  w.  j a va 2  s. com*/
    return loanTypeDao.getByParam(parameter, firstResult, maxResults, orderable);
}

From source file:org.hcmut.emr.sentence.SentenceServiceImpl.java

@Override
@Transactional(isolation = Isolation.REPEATABLE_READ)
public void lableForOneRecord(long recordId) {
    System.out.println("SentenceServiceImpl - Lable For One");
    try {//from www .  j  a  v a  2s.c  o  m
        List<Sentence> sentenses = sentenceDao.search(recordId, "record.id", "=", 0, 1000000000);
        System.out.println("Total sentences " + sentenses.size());
        List<NameValuePair> headers = SessionHelper.getListSession();

        String current = "none";
        for (Sentence sentence : sentenses) {
            List<Word> words = wordDao.search(sentence.getId(), "sentence.id", "=", 0, 1000);

            current = isHeader(sentence.getContent(), headers, current);
            for (Word word : words) {
                word.setSessionTag(current);
                wordDao.update(word);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

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

@Override
@Transactional(readOnly = true, isolation = Isolation.REPEATABLE_READ, propagation = Propagation.SUPPORTS, timeout = 30)
public Long getTotalLoanTypeByParam(LoanTypeSearchParameter parameter) {
    return loanTypeDao.getTotalLoanTypeByParam(parameter);
}

From source file:locksdemo.JdbcLockService.java

@Override
@Transactional(isolation = Isolation.REPEATABLE_READ)
public Lock create(String name) throws LockExistsException {
    Lock lock = getLock(name);//from  ww  w  .j  a v  a2 s  .c  o  m
    if (lock != null) {
        if (lock.isExpired()) {
            jdbcTemplate.update(deleteQuery, lock.getName(), lock.getValue());
        } else {
            throw new LockExistsException();
        }
    }
    lock = new Lock(name, UUID.randomUUID().toString(), new Date(System.currentTimeMillis() + expiry));
    jdbcTemplate.update(createQuery, lock.getName(), lock.getValue(), lock.getExpires());
    return lock;
}

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

@Override
@Transactional(readOnly = true, isolation = Isolation.REPEATABLE_READ, propagation = Propagation.SUPPORTS, timeout = 30)
public OhsaIncidentDocument getEntiyByPK(Integer intgr) throws Exception {
    return this.ohsaIncidentDocumentDao.getEntiyByPK(intgr);
}

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

@Override
@Transactional(readOnly = true, isolation = Isolation.REPEATABLE_READ, propagation = Propagation.SUPPORTS, timeout = 50)
public List<PayTempOvertime> getByParam(PayTempOvertimeSearchParameter searchParameter, int firstResult,
        int maxResults, Order order) throws Exception {
    return payTempOvertimeDao.getByParam(searchParameter, firstResult, maxResults, order);
}

From source file:com.inkubator.sms.gateway.service.impl.UserServiceImpl.java

@Override
@Transactional(readOnly = false, isolation = Isolation.REPEATABLE_READ, propagation = Propagation.SUPPORTS, timeout = 50)
public List<SmsGatewayUser> getAllByFullTextService(String parameter, int minResult, int maxResult, Order order)
        throws Exception {
    return userDao.getAllByFullTextService(parameter, minResult, maxResult, order);
}

From source file:org.alienlabs.hatchetharry.persistence.dao.CounterDaoImpl.java

/**
 * Save the Counter to the DB//from  www  .  j  a va 2  s.c  o m
 * 
 * @param Counter
 * @return persistent instance of Counter
 */
@Override
@Transactional(isolation = Isolation.REPEATABLE_READ)
public Counter save(final Counter counter) {
    return (Counter) this.getSession().merge(counter);
}

From source file:com.apress.prospringintegration.springenterprise.stocks.transactions.annotation.AnnotationTxStockBrokerService.java

@Transactional(isolation = Isolation.REPEATABLE_READ, timeout = 30, readOnly = true)
@SuppressWarnings("unchecked")
public BestAsk findBestPrice(Order o) throws Exception {
    BestAsk bestAsk = new BestAsk();
    List<Stock> rets = (List<Stock>) hibernateTemplate.find(
            "from Stock s where " + "s.pricePerShare <= ? and " + "s.quantityAvailable >= ? and s.symbol = ?",
            new Object[] { o.getBid(), o.getQuantity(), o.getSymbol() }, String.class);
    if (!rets.isEmpty()) {
        Stock stock = stockDao.findByInventoryCode(rets.get(0).getInventoryCode());
        bestAsk.setStock(stock);/*from   w  w w. ja v a 2 s  .  co  m*/
    }

    return bestAsk;
}