本文整理汇总了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();
}