本文整理匯總了Java中org.apache.ibatis.session.ExecutorType.REUSE屬性的典型用法代碼示例。如果您正苦於以下問題:Java ExecutorType.REUSE屬性的具體用法?Java ExecutorType.REUSE怎麽用?Java ExecutorType.REUSE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.apache.ibatis.session.ExecutorType
的用法示例。
在下文中一共展示了ExecutorType.REUSE屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: write
@Transactional(
exceptionMessage = "usage sync job failed",
executorType = ExecutorType.REUSE
)
private void write(List<Integer> neoNodeIdbatch) throws Exception {
for (Integer id : neoNodeIdbatch) {
NameUsage u = dao.readUsage(id);
ParsedName pn = dao.readName(id);
NameUsageMetrics m = dao.readMetrics(id);
boolean insert = dao.isInsert(u);
syncService.syncUsage(insert, u, pn, m);
// remember usageKey and things about this record
if (insert) {
inserts.add(id);
}
usageKeys.put(id, u.getKey());
// tell main importer about the new usageKey so we can prepare usages with good foreign keys
dao.reportUsageKey(id, u.getKey());
}
}
示例2: call
@Override
@Transactional(
exceptionMessage = "usage sync job failed",
executorType = ExecutorType.REUSE
)
public List<NameUsage> call() throws Exception {
LogContext.startDataset(datasetKey);
LOG.debug("Starting usage sync with {} usages", usages.size());
Iterator<ParsedName> nIter = names.iterator();
for (NameUsage u : usages) {
// pro parte usages are synonyms and do not have any descendants, synonyms, etc
NameUsageMetrics m = new NameUsageMetrics();
ParsedName pn = nIter.next();
m.setKey(u.getKey());
m.setNumDescendants(0);
boolean insert = dao.isInsert(u);
syncService.syncUsage(insert, u, pn, m);
}
LOG.debug("Completed batch of {} pro parte usages", usages.size());
LogContext.endDataset();
return usages;
}
示例3: askForValidation
@Override
@Transactional(executorType = ExecutorType.REUSE)
public Map<String, Integer> askForValidation(List<String> urls) {
return urls.stream().map((url) -> {
Validation validation = new Validation();
validation.setDate(new Date());
validation.setUrl(validateUrl(url));
validation.setStatus(Validation.Status.UNDEFINED);
validationDao.insertValidation(validation);
return validation;
}).collect(Collectors.toMap(Validation::getUrl, Validation::getId));
}
示例4: deleteBatch
@Transactional(
exceptionMessage = "usage deletion job failed",
executorType = ExecutorType.REUSE
)
private void deleteBatch(List<Integer> batch) throws Exception {
for (Integer key : batch) {
syncService.delete(key);
}
}
示例5: updateForeignKeyBatch
@Transactional(
exceptionMessage = "foreign key update job failed",
executorType = ExecutorType.REUSE
)
private List<Integer> updateForeignKeyBatch(List<UsageForeignKeys> fks) {
List<Integer> ids = Lists.newArrayList();
for (UsageForeignKeys fk : fks) {
// update usage by usage doing both potential updates in one statement
syncService.updateForeignKeys(fk.getUsageKey(), fk.getParentKey(), fk.getBasionymKey());
ids.add(fk.getUsageKey());
}
return ids;
}