List of usage examples for org.springframework.transaction.annotation Propagation REQUIRES_NEW
Propagation REQUIRES_NEW
To view the source code for org.springframework.transaction.annotation Propagation REQUIRES_NEW.
Click Source Link
From source file:com.orange.clara.cloud.servicedbdumper.task.job.JobFactory.java
@Transactional(propagation = Propagation.REQUIRES_NEW) public Job createJob(JobType jobType, DatabaseRef databaseRefSrc, DatabaseRef databaseRefTarget, Date dumpDate, DbDumperServiceInstance dbDumperServiceInstance) { Job job = new Job(jobType, databaseRefSrc, databaseRefTarget, dumpDate, dbDumperServiceInstance); if (this.jobRepo.findByJobTypeAndJobEventAndDatabaseRefSrcAndDatabaseRefTarget(jobType, JobEvent.START, databaseRefSrc, databaseRefTarget).size() > 0 || this.jobRepo.findByJobTypeAndJobEventAndDatabaseRefSrcAndDatabaseRefTarget(jobType, JobEvent.RUNNING, databaseRefSrc, databaseRefTarget).size() > 0) { job.setJobEvent(JobEvent.SCHEDULED); this.logger.info(String.format( "Job type: %s for database source '%s' and database target '%s' has been scheduled.", jobType.toString(), databaseRefSrc.getDatabaseName(), databaseRefTarget.getDatabaseName())); }//w w w . j a v a2s . c o m return this.jobRepo.save(job); }
From source file:org.skife.jdbi.v2.spring.DummyService.java
@Override @Transactional(propagation = Propagation.REQUIRES_NEW, isolation = Isolation.READ_UNCOMMITTED) public void inRequiresNewReadUncommitted(Callback c) { c.call(dbi); }
From source file:co.com.dcm.stc.service.ws.impl.STCProcessServiceImpl.java
@Transactional(propagation = Propagation.REQUIRES_NEW) @Override/*from w ww. j a v a 2 s .co m*/ public STCBasicResponse createAnnouncements(AnnouncementRequest request) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("[Ejcutando Metodo [createAnnouncements]]"); LOGGER.debug("[Param[request = " + request + "]]"); LOGGER.debug("logRepository = " + logService); } STCBasicResponse stcBasicResponse = new STCBasicResponse(true, request.toString()); try { LogRecord log = new LogRecord("createAnnouncements", request.toString(), new Date()); log = logService.saveLog(log); log.setResponseData(stcBasicResponse.toString()); log.setResponseTime(new Date()); logService.saveLog(log); } catch (STCServiceException e) { stcBasicResponse.setSuccess(false); stcBasicResponse.setMessage(e.getMessage()); stcBasicResponse.setErrorCode(e.getError().getCode()); } catch (Exception exc) { LOGGER.error(exc.getMessage(), exc); stcBasicResponse.setSuccess(false); stcBasicResponse.setMessage(exc.getMessage()); stcBasicResponse.setErrorCode(STCErrorCodeEnum.UNKNOWN_ERROR.getCode()); } return stcBasicResponse; }
From source file:org.openmrs.module.auditlog.MockNestedServiceImpl.java
@Override @Transactional(propagation = Propagation.REQUIRES_NEW) public void innerTransaction(boolean rollback) { EncounterType et = Context.getEncounterService().getEncounterType(ENCOUNTER_TYPE_ID); et.setDescription("Some new description"); Context.getEncounterService().saveEncounterType(et); if (rollback) { throw new APIException(); }//from w w w .ja v a 2 s .co m }
From source file:kr.co.exsoft.common.service.CommonService.java
/** * //from w w w. ja v a2s. c o m * <pre> * 1. : ? ? :: nextValTable / nextVal * 2. : * </pre> * @Method Name : commonNextVal * @param counter_id * @return * @throws Exception int */ @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = { Exception.class, SQLException.class }) public int commonNextVal(String counter_id) throws Exception;
From source file:com.google.ie.business.dao.impl.IdeaCategoryDaoImpl.java
@Override @Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW) public IdeaCategory saveIdeaCategory(IdeaCategory category) { Date date = new Date(); category.setCreatedOn(date);/* ww w.java 2 s . c o m*/ category.setUpdatedOn(date); IdeaCategory savedCategory = getJdoTemplate().makePersistent(category); return savedCategory; }
From source file:cs544.blog.service.BlogService.java
@Transactional(propagation = Propagation.REQUIRES_NEW) @Override public List<Post> getUserPosts(long userId) { return userDAO.getUserPosts(userId); }
From source file:de.voolk.marbles.persistence.services.AuthentificationServiceTest.java
@Test @Transactional(propagation = Propagation.REQUIRES_NEW) public void authentification() { assertFalse(authentificationService.authenticate("unit-test-01", "123")); User user = authentificationService.createUser("unit-test-01", "a@b.com", "123"); assertFalse(authentificationService.authenticate("unit-test-01", "")); assertTrue(authentificationService.authenticate("unit-test-01", "123")); authentificationService.removeUser(user.getId()); assertFalse(authentificationService.authenticate("unit-test-01", "123")); }
From source file:com.example.securelogin.domain.service.passwordreissue.PasswordReissueFailureSharedServiceImpl.java
@Transactional(propagation = Propagation.REQUIRES_NEW) @Override//from w w w . ja v a 2s . co m public void resetFailure(String username, String token) { FailedPasswordReissue event = new FailedPasswordReissue(); event.setToken(token); event.setAttemptDate(dateFactory.newTimestamp().toLocalDateTime()); failedPasswordReissueRepository.create(event); }
From source file:com.orange.clara.cloud.servicedbdumper.task.asynctask.RestoreDumpTask.java
@Async @Transactional(propagation = Propagation.REQUIRES_NEW) public Future<Boolean> runTask(Integer jobId) throws AsyncTaskException { Job job = this.jobRepo.findOne(jobId); try {// w w w. j av a 2 s. c om this.restorer.restore(job.getDbDumperServiceInstance(), job.getDatabaseRefTarget(), job.getDumpDate()); } catch (RestoreException e) { logger.error(String.format("Cannot restore dump for '%s' in '%s': %s", job.getDatabaseRefSrc().getDatabaseName(), job.getDatabaseRefTarget().getDatabaseName(), e.getMessage())); job.setJobEvent(JobEvent.ERRORED); job.setErrorMessage(e.getMessage()); this.databaseRefManager.deleteServiceKey(job); jobRepo.save(job); return new AsyncResult<Boolean>(false); } this.databaseRefManager.deleteServiceKey(job); job.setJobEvent(JobEvent.FINISHED); jobRepo.save(job); return new AsyncResult<Boolean>(true); }