当前位置: 首页>>代码示例>>Java>>正文


Java Propagation.NOT_SUPPORTED属性代码示例

本文整理汇总了Java中org.springframework.transaction.annotation.Propagation.NOT_SUPPORTED属性的典型用法代码示例。如果您正苦于以下问题:Java Propagation.NOT_SUPPORTED属性的具体用法?Java Propagation.NOT_SUPPORTED怎么用?Java Propagation.NOT_SUPPORTED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.springframework.transaction.annotation.Propagation的用法示例。


在下文中一共展示了Propagation.NOT_SUPPORTED属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: supportsCompletableFuturesAsReturnTypeWrapper

/**
 * Here we demonstrate the usage of {@link CompletableFuture} as a result wrapper for asynchronous repository query
 * methods. Note, that we need to disable the surrounding transaction to be able to asynchronously read the written
 * data from from another thread within the same test method.
 */
@Test
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public void supportsCompletableFuturesAsReturnTypeWrapper() throws Exception {

	repository.save(new Customer("Customer1", "Foo"));
	repository.save(new Customer("Customer2", "Bar"));

	CompletableFuture<Void> future = repository.readAllBy().thenAccept(customers -> {

		assertThat(customers, hasSize(2));
		customers.forEach(customer -> log.info(customer.toString()));
		log.info("Completed!");
	});

	while (!future.isDone()) {
		log.info("Waiting for the CompletableFuture to finish...");
		TimeUnit.MILLISECONDS.sleep(500);
	}

	future.get();

	log.info("Done!");
}
 
开发者ID:Just-Fun,项目名称:spring-data-examples,代码行数:28,代码来源:Java8IntegrationTests.java

示例2: initSaveValidcode

/** 初始化,保存充值验证码记录 */
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public ThirdPayValidcode initSaveValidcode(PayRequest payRequest) throws Exception {
	ThirdPayValidcode valid = new ThirdPayValidcode();
	valid.initPrimaryKey();
	valid.setAmount(payRequest.getMust().getAmount());
	valid.setPayChannel(payRequest.getSys().getPayChannel());
	valid.setSendTime(DateUtils.today());
	valid.setSerialnumber(KeyInfo.getInstance().getDateKey());
	valid.setUserId(payRequest.getMust().getUserId());
	valid.setUserLoginName(payRequest.getMust().getUserLoginName());
	try {
		thirdPayValidcodeService.save(null, valid);
	} catch (DataBaseAccessException e) {
		throw new Exception(ErrorMsgConstant.ERR_OPERATE_DATABASE);
	}
	return valid;
}
 
开发者ID:yi-jun,项目名称:aaden-pay,代码行数:18,代码来源:PaymentTransaction.java

示例3: parseUpdatePayRecord

/** 解析支付返回,更新支付记录 */
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public void parseUpdatePayRecord(ThirdPayResponse tpResp, ThirdPayRecord payRecord) {
	payRecord.setSendCount(payRecord.getSendCount() + 1);
	payRecord.setOldTradeStatus(payRecord.getTradeStatus());
	if (tpResp == null) {
		payRecord.setTradeStatus(TradeStatus.RETRY);
	} else {
		payRecord.setSendStatus(tpResp.getSendStatus());
		payRecord.setPayCode(tpResp.getPayCode());
		payRecord.setPayMessage(tpResp.getPayMessage());
		payRecord.setUpdateTime(DateUtils.today());
		payRecord.setSettleTime(tpResp.getSettleTime());
		payRecord.setThirdnumber(tpResp.getThirdnumber());
		payRecord.setTradeStatus(tpResp.getTradeStatus());
		if (payRecord.isSuccess()) {
			payRecord.setActAmount(tpResp.getActAmount());
		}
	}
	try {
		thirdPayRecordService.update(null, payRecord);
	} catch (DataBaseAccessException e) { // 更新支付记录数据库异常,不抛出
		logger.error(" doCallBack save ThirdPayRecordDtl DataBaseAccessException", e);
	}

	// 移除认证支付缓存
	if (payRecord.isSuccess() && payRecord.getPayType() == PayType.AUTHPAY) {
		payCacheService.removePayToken(payRecord.getUserId());
	}

}
 
开发者ID:yi-jun,项目名称:aaden-pay,代码行数:31,代码来源:PaymentTransaction.java

示例4: findAll

@Override
@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
public List<E> findAll(Sort sort) {
	return getRepository().findAll(sort);
}
 
开发者ID:onsoul,项目名称:os,代码行数:5,代码来源:GenericService.java

示例5: insert

@Transactional(propagation = Propagation.NOT_SUPPORTED , isolation = Isolation.READ_UNCOMMITTED )
public void insert(){
	System.out.println(TransactionSynchronizationManager.getCurrentTransactionIsolationLevel());
	System.out.println(">>>>>" + TransactionCacheContextHolder.getContext());
	Test test = new Test();
	test.setA(new Random().nextInt());
	sqlMapper.insert(test);
}
 
开发者ID:yaoakeji,项目名称:hibatis,代码行数:8,代码来源:Service2.java

示例6: afterCommitAll

@Transactional(propagation = Propagation.NOT_SUPPORTED)
protected void afterCommitAll(ItemOperationParams params)
{
	if( params.isNotificationsAdded() )
	{
		notificationService.processEmails();
	}
	for( ApplicationEvent<?> event : params.getAfterCommitAllEvents() )
	{
		eventService.publishApplicationEvent(event);
	}

	List<ItemOperationFilter> filters = params.getExtraFilters();
	if( filters != null )
	{
		for( ItemOperationFilter filter : filters )
		{
			try
			{
				operateAll(filter);
			}
			catch( WorkflowException e )
			{
				logger.error("Error running filter", e);
			}
		}
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:28,代码来源:ItemServiceImpl.java

示例7: find

@Override
@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
public E find(PK id) {
	return getRepository().findOne(id);
}
 
开发者ID:onsoul,项目名称:os,代码行数:5,代码来源:GenericService.java

示例8: asyncSave

@Async
@Transactional(propagation = Propagation.NOT_SUPPORTED )
@Override
public void asyncSave ( SystemLog systemLog ) {
	super.insert( systemLog );
   }
 
开发者ID:yujunhao8831,项目名称:spring-boot-start-current,代码行数:6,代码来源:SystemLogServiceImpl.java

示例9: exists

@Override
@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
public boolean exists(PK id) {
	return getRepository().exists(id);
}
 
开发者ID:onsoul,项目名称:os,代码行数:5,代码来源:GenericService.java

示例10: count

@Override
@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
public long count() {
	return getRepository().count();
}
 
开发者ID:onsoul,项目名称:os,代码行数:5,代码来源:GenericService.java

示例11: rejectsStreamExecutionIfNoSurroundingTransactionActive

/**
 * Query methods using streaming need to be used inside a surrounding transaction to keep the connection open while
 * the stream is consumed. We simulate that not being the case by actively disabling the transaction here.
 */
@Test(expected = InvalidDataAccessApiUsageException.class)
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public void rejectsStreamExecutionIfNoSurroundingTransactionActive() {
	repository.findAllByLastnameIsNotNull();
}
 
开发者ID:Just-Fun,项目名称:spring-data-examples,代码行数:9,代码来源:Java8IntegrationTests.java


注:本文中的org.springframework.transaction.annotation.Propagation.NOT_SUPPORTED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。