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:es.upm.fiware.rss.expenditureLimit.manager.test.BalanceAccumulateManagerTest.java

/**
 * //from  w  ww. j  a  v  a2  s.  c  o m
 */
@Transactional(propagation = Propagation.SUPPORTS)
public void getUserAccumulated() throws RSSException {
    BalanceAccumulateManagerTest.logger.debug("Into getUserAccumulated method.");
    AccumsExpend result = balanceAccumulateManager.getUserAccumulated(endUserId, serviceName, "agg123",
            "app123456", "EUR", "daily");
    Assert.assertNotNull(result);
    Assert.assertTrue("No controls files found", result.getAccums().size() > 0);

}

From source file:it.geosdi.era.server.dao.hibernate.DAOProgettoHibernate.java

@Transactional(propagation = Propagation.SUPPORTS)
public Progetto findLayerByIdProgetto(long id) {
    Query query = getSession().createQuery(
            "select progetto from Progetto progetto join fetch progetto.layers layer where progetto.id = ?");
    query.setParameter(1, id);//from  w  w  w  .  ja  v a  2 s.c o m
    return (Progetto) query.uniqueResult();
}

From source file:it.geosdi.era.server.dao.hibernate.DAOUtenteHibernate.java

@Transactional(propagation = Propagation.SUPPORTS)
public void flush(Utente utente) {
    getSession().evict(utente);
}

From source file:es.upm.fiware.rss.expenditureLimit.dao.impl.tests.DbeExpendControlDaoTest.java

@Transactional(propagation = Propagation.SUPPORTS)
public void testGetExpendLimitDataForaUser() {

    BmCurrency bmCurrency = new BmCurrency();
    bmCurrency.setNuCurrencyId(1);/*  ww w  .j  av a  2s.  c  o  m*/
    List<DbeExpendControl> l = expLimitDao.getExpendDataForUserAppProvCurrency("userId01", "agg123",
            "app123456", bmCurrency);

    Assert.assertTrue("Elements founds", l != null && l.size() == 3);
    Iterator<DbeExpendControl> it = l.iterator();
    while (it.hasNext()) {
        DbeExpendControl el = it.next();
        if (!el.getId().getTxAppProviderId().equalsIgnoreCase("app123456")) {
            Assert.fail("Application provider invalid: " + el.getId().getTxAppProviderId());
        }
        if (!el.getId().getTxEndUserId().equalsIgnoreCase("userId01")) {
            Assert.fail("User invalid: " + el.getId().getTxEndUserId());
        }
    }
}

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

/**
 * //from   w  ww  . jav a 2s  . c  o  m
 */
@Transactional(propagation = Propagation.SUPPORTS)
public void checkRequiredParametersTest() throws RSSException {
    ExpenditureLimitDataCheckerTest.logger.debug("Into checkChargeRequiredParametersTest mehtod");
    thrown.expect(RSSException.class);
    thrown.expectMessage("Required parameters not found:enUserId, service, appProvider, currency.");
    checker.checkRequiredParameters("urlEndUserId", "service", "aggId", "appPorviderId", "currency");
    ExpenditureLimitDataCheckerTest.logger.debug("No exception expected");
    checker.checkRequiredParameters(null, "service", "aggId", "appPorviderId", "currency");

}

From source file:com.brienwheeler.svc.attrs.impl.PersistentAttributeServiceBase.java

@Override
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
@MonitoredWork("getAttribute")
@GracefulShutdown/*w ww . ja  v a2 s.c o m*/
public String getAttribute(DbId<OwnerClass> owner, String name) {
    DbValidationUtils.assertPersisted(owner);
    name = ValidationUtils.assertNotEmpty(name, "name cannot be empty");

    AttrClass attribute = persistentAttributeDao.findByOwnerAndName(owner.getId(), name);
    return attribute == null ? null : attribute.getValue();
}

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

/**
 * /*from  w ww.  j a v  a 2s .c  o  m*/
 */
@Transactional(propagation = Propagation.SUPPORTS)
public void getGeneralProviderExpLimits() throws RSSException {
    ExpenditureLimitManagerTest.logger.debug("Into getGeneralProviderExpLimits method");
    LimitGroupBean limits = elManager.getGeneralProviderExpLimitsBean(aggregator, appProvider, service,
            currency, type);
    ExpenditureLimitManagerTest.logger.debug("Limits size:" + limits.getLimits().size());
    Assert.assertEquals(1, limits.getLimits().size());
    Assert.assertEquals(service, limits.getService());
    Assert.assertEquals(currency, limits.getLimits().get(0).getCurrency());
    Assert.assertEquals(type, limits.getLimits().get(0).getType());
}

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

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

From source file:de.crowdcode.bitemporal.example.AddressServiceImpl.java

@Override
@Transactional(propagation = Propagation.SUPPORTS)
public Collection<Address> findAddressesChangedByRevisionNumber(Integer revisionNumber) {
    Collection<Object> objects = addressRepository.findEntitiesChangedByRevisionNumber(revisionNumber);
    logger.info("findAddressesChangedByRevisionNumber: amount of objects: " + objects.size());

    Collection<Address> addresses = new ArrayList<Address>();
    for (Object object : objects) {
        if (object instanceof Address) {
            addresses.add((Address) object);
        }// w  w w. j a v  a  2s  .  co  m
    }

    logger.info("findAddressesChangedByRevisionNumber: amount of addresses: " + addresses.size());
    return addresses;
}

From source file:es.upm.fiware.rss.controller.SettlementControllerTest.java

/**
 * //from  www  .  j a v a2s.c  o m
 */
@Transactional(propagation = Propagation.SUPPORTS)
public void testSettlement() {
    logger.debug("into testLogout method");
    String response = controller.settlement(null, model);
    Assert.assertEquals("error", response);
    logger.debug("Correct logout");
    response = controller.settlement(request, model);
    Assert.assertEquals("settlement", response);

    logger.debug("Correct logout with session data");
    Mockito.when(session.getAttribute(USER_SESSION)).thenReturn(sessionData);
    response = controller.settlement(request, model);
    Assert.assertEquals("settlement", response);
}