Examples of PlatformTransactionManager


Examples of org.springframework.transaction.PlatformTransactionManager

   * @param activityInst
   * @param action
   * @return
   */
  private static void executeLogicInNewTransaction(ActivityElement activityXml, ActivityInst activityInst, IAction action) {
    PlatformTransactionManager txManager = ApplicationContextHolder.getBean(PlatformTransactionManager.class);
    DefaultTransactionDefinition definition = new DefaultTransactionDefinition();
    definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
    TransactionStatus status = txManager.getTransaction(definition);
    try {
      action.execute(activityXml, activityInst);
      txManager.commit(status);
    } catch (Exception e) {
      txManager.rollback(status);
      throw new ProcessEngineException("触发事件执行失败", e);
    }
  }
View Full Code Here

Examples of org.springframework.transaction.PlatformTransactionManager

    Assert.notNull(applicationContext);
    this.applicationContext = applicationContext;
    this.configuration = configuration;
   
    //获取事务Bean
    PlatformTransactionManager transactionManager = null;
    if(this.applicationContext.containsBean(TRANSACTION_MANAGER_NAME) &&
        configuration.getBoolean(Environment.IS_USE_TRANSACTION)) {
      transactionManager = (PlatformTransactionManager)this.applicationContext.getBean(TRANSACTION_MANAGER_NAME);
    } else {
      logger.warn("Process Engine no Transaction");
View Full Code Here

Examples of org.springframework.transaction.PlatformTransactionManager

   * @param action
   * @return
   */
  private static void executeLogicInNewTransaction(ProcessDefine processDefine,
      ProcessInstance processInstance, IAction action) {
    PlatformTransactionManager txManager = ApplicationContextHolder.getBean(PlatformTransactionManager.class);
    DefaultTransactionDefinition definition = new DefaultTransactionDefinition();
    definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
    TransactionStatus status = txManager.getTransaction(definition);
    try {
      action.execute(processDefine, processInstance);
      txManager.commit(status);
    } catch (Exception e) {
      txManager.rollback(status);
      throw new ProcessEngineException("触发事件执行失败", e);
    }
  }
View Full Code Here

Examples of org.springframework.transaction.PlatformTransactionManager

    context.register(BatchConfiguration.class);
    context.refresh();
    JobRepository jobRepository = context.getBean(JobRepository.class);
    jobLauncher = context.getBean(JobLauncher.class);
    jobs = new JobBuilderFactory(jobRepository);
    PlatformTransactionManager transactionManager = this.context.getBean(PlatformTransactionManager.class);
    steps = new StepBuilderFactory(jobRepository, transactionManager);
    step = steps.get("step").tasklet(new Tasklet() {
      @Override
      public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
        return null;
View Full Code Here

Examples of org.springframework.transaction.PlatformTransactionManager

    MultiTransactionStatus multiTransactionStatus = (MultiTransactionStatus) status;

    boolean commit = true;
    Exception commitException = null;
    PlatformTransactionManager commitExceptionTransactionManager = null;

    for (PlatformTransactionManager transactionManager : reverse(transactionManagers)) {

      if (commit) {
View Full Code Here

Examples of org.springframework.transaction.PlatformTransactionManager

   * @see org.springframework.transaction.PlatformTransactionManager#rollback(org.springframework.transaction.TransactionStatus)
   */
  public void rollback(TransactionStatus status) throws TransactionException {

    Exception rollbackException = null;
    PlatformTransactionManager rollbackExceptionTransactionManager = null;

    MultiTransactionStatus multiTransactionStatus = (MultiTransactionStatus) status;

    for (PlatformTransactionManager transactionManager : reverse(transactionManagers)) {
      try {
View Full Code Here

Examples of org.springframework.transaction.PlatformTransactionManager

  ChainedTransactionManager tm;

  @Test
  public void shouldCompleteSuccessfully() throws Exception {

    PlatformTransactionManager transactionManager = createNonFailingTransactionManager("single");
    setupTransactionManagers(transactionManager);

    createAndCommitTransaction();

    assertThat(transactionManager, isCommitted());
View Full Code Here

Examples of org.springframework.transaction.PlatformTransactionManager

  }

  @Test
  public void shouldCommitAllRegisteredTransactionManagers() {

    PlatformTransactionManager first = createNonFailingTransactionManager("first");
    PlatformTransactionManager second = createNonFailingTransactionManager("second");

    setupTransactionManagers(first, second);
    createAndCommitTransaction();

    assertThat(first, isCommitted());
View Full Code Here

Examples of org.springframework.transaction.PlatformTransactionManager

  }

  @Test
  public void shouldCommitInReverseOrder() {

    PlatformTransactionManager first = createNonFailingTransactionManager("first");
    PlatformTransactionManager second = createNonFailingTransactionManager("second");

    setupTransactionManagers(first, second);
    createAndCommitTransaction();

    assertThat("second tm commited before first ", commitTime(first) >= commitTime(second), is(true));
View Full Code Here

Examples of org.springframework.transaction.PlatformTransactionManager

  }

  @Test
  public void shouldRollbackAllTransactionManagers() throws Exception {

    PlatformTransactionManager first = createNonFailingTransactionManager("first");
    PlatformTransactionManager second = createNonFailingTransactionManager("second");

    setupTransactionManagers(first, second);
    createAndRollbackTransaction();

    assertThat(first, wasRolledback());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.