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

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

From source file:com.brienwheeler.svc.usergroups.impl.UserGroupMemberDao.java

@Override
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public UserGroupMember findForGroupAndUser(UserGroup userGroup, User user) {
    Query query = entityManager/* w w  w.j a va2s.  c o  m*/
            .createQuery("from UserGroupMember where userGroup = :userGroup and user = :user");
    query.setParameter("userGroup", userGroup);
    query.setParameter("user", user);
    return getSingleResultOrNull(query);
}

From source file:com.devicehive.service.DeviceEquipmentService.java

@Transactional(propagation = Propagation.SUPPORTS)
public DeviceEquipmentVO findByCodeAndDevice(@NotNull String code, @NotNull DeviceVO device) {
    return deviceEquipmentDao.getByDeviceAndCode(code, device);
}

From source file:io.cloudslang.engine.queue.services.recovery.MessageRecoveryServiceImpl.java

@Override
@Transactional(propagation = Propagation.SUPPORTS)
public void logMessageRecovery(List<ExecutionMessage> messages) {
    if (!CollectionUtils.isEmpty(messages)) {
        logger.warn("Will do recovery for " + messages.size() + " messages. ");
        if (logger.isDebugEnabled()) {
            for (ExecutionMessage msg : messages) {
                logger.debug("Will do recovery for messages with ExecStateId = " + msg.getExecStateId());
            }/*from w  w w  .  j av a  2s  .co  m*/
        }
    }
}

From source file:org.horizontaldb.example.model.dao.DepartmentDaoImpl.java

@Override
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public Department getDepartmentByName(String name) {
    Query query = getQueryBuilder().query("from Department where name = :name").build();

    query.setParameter("name", name);

    Department retval = (Department) query.uniqueResult();

    return retval;
}

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

/** {@inheritDoc} */
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public Image getGoogleMapImage(final BigDecimal latitude, final BigDecimal longitude, final Integer zoomLevel) {

    if (longitude == null) {
        throw new IllegalArgumentException("Longitude cannot be null.");
    }//www .  ja v a  2s  . com

    if (latitude == null) {
        throw new IllegalArgumentException("Latitude cannot be null.");
    }

    if (zoomLevel == null) {
        throw new IllegalArgumentException("ZoomLevel cannot be null.");
    }

    final URI url = GoogleMapsUtils.buildGoogleMapsStaticUrl(latitude, longitude, zoomLevel);

    BufferedImage img;
    try {
        URLConnection conn = url.toURL().openConnection();
        img = ImageIO.read(conn.getInputStream());
    } catch (UnknownHostException e) {
        LOGGER.error("Google static MAPS web service is not reachable (UnknownHostException).", e);
        img = new BufferedImage(GoogleMapsUtils.defaultWidth, 100, BufferedImage.TYPE_INT_RGB);

        final Graphics2D graphics = img.createGraphics();

        final Map<Object, Object> renderingHints = CollectionUtils.getHashMap();
        renderingHints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        graphics.addRenderingHints(renderingHints);
        graphics.setBackground(Color.WHITE);
        graphics.setColor(Color.GRAY);
        graphics.clearRect(0, 0, GoogleMapsUtils.defaultWidth, 100);

        graphics.drawString("Not Available", 30, 30);

    } catch (IOException e) {
        throw new IllegalStateException(e);
    }

    return img;
}

From source file:com.dianping.cache.service.CacheConfigurationService.java

/**
 * ??APP?????.net(category+params)/*from w w  w. j av  a  2  s. co  m*/
 * @param cacheType
 * @param key
 * @param category
 * @param params
 */
@Transactional(propagation = Propagation.SUPPORTS)
void clearByKeyBothSide(String cacheType, String key, String category, List<Object> params);

From source file:com.auditbucket.engine.service.TrackEventService.java

@Transactional(propagation = Propagation.SUPPORTS)
public ChangeEvent processEvent(Company company, String eventCode) {
    return trackEventDao.createEvent(company, eventCode);
}

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

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

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

@Override
@Transactional(propagation = Propagation.SUPPORTS)
public Collection<Address> findAllAddresses() {
    Collection<Address> addresses = addressRepository.findAll();
    return addresses;
}