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.hrm.service.impl.BioDataServiceImpl.java

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 30)
public BioData getEntiyByPK(Long id) throws Exception {
    BioData bioData = bioDataDao.getEntiyByPK(id);
    /*bioData.getCity().getCityName();
    bioData.getReligion().getName();// w  ww  .j  ava 2  s .  c o m
    bioData.getMaritalStatus().getName();
    bioData.getNationality().getNationalityName();
    bioData.getRace().getRaceName();
    bioData.getDialect().getDialectName();*/
    return bioData;
}

From source file:org.jrecruiter.service.impl.UserServiceImpl.java

/** {@inheritDoc} */
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public Long getUsersCount() {
    return userDao.getUsersCount();
}

From source file:com.oak_yoga_studio.dao.impl.EnrollmentDAOImpl.java

@Transactional(propagation = Propagation.SUPPORTS)
@Override/*from  w  w w .j a v  a 2s  .c om*/
public long getEnrollmentsCountBySection(Section section) {

    Query query = sf.getCurrentSession()
            .createQuery("select count(e.id) from Enrollment e where  e.section =:section "
                    + " and ( e.status ='ACTIVE' OR e.status ='INPROGRESS' )  ");
    query.setParameter("section", section);

    long count = (Long) query.uniqueResult();

    System.out.println("count is  " + count);

    return count;

}

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

@Override
@Transactional(readOnly = false, isolation = Isolation.REPEATABLE_READ, propagation = Propagation.SUPPORTS, timeout = 50)
public List<Role> getAllByTextFullService(String parameter, int minResult, int maxResult, Order order) {
    //        System.out.println("muahahahah");
    return roleDao.getAllByFullTextService(parameter, minResult, maxResult, order);
}

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

/**
 * {@inheritDoc}//from   ww  w . j a v a2s.  co  m
 */
@SuppressWarnings("unchecked")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public List<T> findByNamedQuery(String queryName, Map<String, ? extends Object> args) {
    Query namedQuery = entityManager.createNamedQuery(queryName);
    for (Map.Entry<String, ? extends Object> parameter : args.entrySet()) {
        namedQuery.setParameter(parameter.getKey(), parameter.getValue());
    }
    return namedQuery.getResultList();
}

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

/**
 * /* w  w w . ja va 2  s  .  c o m*/
 * @throws RSSException
 */
@Transactional(propagation = Propagation.SUPPORTS)
public void storeGeneralUserExpLimitsNoService() throws RSSException {
    ExpenditureLimitManagerTest.logger.debug("Into storeGeneralProviderExpLimits method");
    thrown.expect(RSSException.class);
    thrown.expectMessage("Service Identifier");
    LimitGroupBean expLimits = ExpenditureLimitBeanConstructor.generateLimitGroupBean();
    expLimits.setService(null);
    elManager.storeGeneralUserExpLimit(aggregator, appProvider, userId, expLimits);
    ExpenditureLimitManagerTest.logger.debug("Exception expected");
}

From source file:com.brienwheeler.svc.authorize_net.impl.CIMClientService.java

@Override
@MonitoredWork/*from  w  w w  . j a  v  a  2s  .co  m*/
@GracefulShutdown
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public List<PaymentMethod> getPaymentMethods(DbId<User> userId) {
    String customerProfileId = userAttributeService.getAttribute(userId, ATTR_PROFILE_ID);
    if (customerProfileId == null)
        return new ArrayList<PaymentMethod>();
    return getPaymentMethods(userId, customerProfileId);
}

From source file:org.jrecruiter.service.impl.UserServiceImpl.java

/** {@inheritDoc} */
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public User getUserByVerificationKey(final String key) {
    return userDao.getUserByVerificationKey(key);
}

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

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

From source file:edu.northwestern.bioinformatics.studycalendar.service.SubjectService.java

/**
 * Derives scheduled events from the given period and applies them to the given scheduled studySegment.
 * <p>//from w  w  w. jav  a  2 s .c om
 * The input period should already match the provided sourceAmendment.
 */
@Transactional(propagation = Propagation.SUPPORTS)
public void schedulePeriod(Period period, Amendment sourceAmendment, String reason,
        ScheduledStudySegment targetStudySegment) {
    schedulePeriod(period, sourceAmendment, reason, null, targetStudySegment);
}