當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。