本文整理匯總了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!");
}
示例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;
}
示例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());
}
}
示例4: findAll
@Override
@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
public List<E> findAll(Sort sort) {
return getRepository().findAll(sort);
}
示例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);
}
示例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);
}
}
}
}
示例7: find
@Override
@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
public E find(PK id) {
return getRepository().findOne(id);
}
示例8: asyncSave
@Async
@Transactional(propagation = Propagation.NOT_SUPPORTED )
@Override
public void asyncSave ( SystemLog systemLog ) {
super.insert( systemLog );
}
示例9: exists
@Override
@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
public boolean exists(PK id) {
return getRepository().exists(id);
}
示例10: count
@Override
@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
public long count() {
return getRepository().count();
}
示例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();
}