Example usage for org.springframework.transaction.annotation Propagation SUPPORTS

List of usage examples for org.springframework.transaction.annotation Propagation SUPPORTS

Introduction

In this page you can find the example usage for org.springframework.transaction.annotation Propagation SUPPORTS.

Prototype

Propagation SUPPORTS

To view the source code for org.springframework.transaction.annotation Propagation SUPPORTS.

Click Source Link

Document

Support a current transaction, execute non-transactionally if none exists.

Usage

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

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 30)
public Integer getTotalByFullTextService(String parameter) throws Exception {
    return this.phoneBookDao.getTotalByFullTextService(parameter);
}

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

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, rollbackFor = Exception.class)
public Long getTotalPositionByParam(PositionSearchParameter searchParameter) throws Exception {
    return this.positionDao.getTotalPositionByParam(searchParameter);
}

From source file:es.upm.fiware.rss.expenditureLimit.manager.test.ExpenditureLimitManagerTest.java

/**
 * /*from  w ww. jav  a 2  s  . com*/
 * @throws RSSException
 */
@Transactional(propagation = Propagation.SUPPORTS)
public void storeGeneralUserExpLimitsNoAppProvider() throws RSSException {
    ExpenditureLimitManagerTest.logger.debug("Into storeGeneralProviderExpLimits method");
    thrown.expect(RSSException.class);
    thrown.expectMessage("Provider Identifier");
    LimitGroupBean expLimits = ExpenditureLimitBeanConstructor.generateLimitGroupBean();
    elManager.storeGeneralUserExpLimit(null, null, userId, expLimits);
    ExpenditureLimitManagerTest.logger.debug("Exception expected");
}

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

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 30)
public Integer getTotalByFullTextService(String parameter) throws Exception {
    return this.groupPhoneDao.getTotalByFullTextService(parameter);
}

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

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

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

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

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

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 30)
public Long getTotalDepartmentByParam(DepartmentSearchParameter searchParameter) throws Exception {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}

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

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 30)
public TempAttendanceRealization getEntiyByPK(Long id) {
    return this.tempAttendanceRealizationDao.getEntiyByPK(id);
}

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

@Override
@Transactional(readOnly = false, isolation = Isolation.REPEATABLE_READ, propagation = Propagation.SUPPORTS, timeout = 30)
public Integer getTotalByFullTextService(String parameter) throws Exception {
    return loginHistoryDao.getTotalByFullTextService(parameter);
}

From source file:se.vgregion.dao.domain.patterns.repository.db.jpa.AbstractJpaRepository.java

/**
 * {@inheritDoc}//from  w w  w  .  ja  v a  2  s.  c o m
 */
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public T findInstanceByNamedQuery(String queryName, Object[] args) {
    Query namedQuery = entityManager.createNamedQuery(queryName);
    if (args != null) {
        int position = 1;
        for (Object value : args) {
            // will throw IllegalArgumentException if position is incorrect
            // or value is incorrect type
            namedQuery.setParameter(position++, value);
        }
    }

    try {
        @SuppressWarnings("unchecked")
        T result = (T) namedQuery.getSingleResult();
        return result;
    } catch (NoResultException nre) {
        return null;
    }
}