Package org.springframework.batch.support.transaction

Examples of org.springframework.batch.support.transaction.ResourcelessTransactionManager


    return new StepBuilderFactory(jobRepository(), transactionManager());
  }

  @Bean
  public PlatformTransactionManager transactionManager() throws Exception {
    return new ResourcelessTransactionManager();
  }
View Full Code Here


      fail();
    } catch (IllegalArgumentException expected) {
      assertEquals("JobRepository must not be null.", expected.getMessage());
    }

    factoryBean.setJobRepository((JobRepository) new MapJobRepositoryFactoryBean(new ResourcelessTransactionManager()).getObject());

    try {
      factoryBean.afterPropertiesSet();
      fail();
    } catch (IllegalArgumentException expected) {
View Full Code Here

  public void setUp() {

    jobRepository = new SimpleJobRepository(new MapJobInstanceDao(), new MapJobExecutionDao(),
        new MapStepExecutionDao(), new MapExecutionContextDao());
    factory.setJobRepository(jobRepository);
    factory.setTransactionManager(new ResourcelessTransactionManager());
    factory.setBeanName("step");
    factory.setItemWriter(writer);
    factory.setCommitInterval(4);

    MessagingTemplate gateway = new MessagingTemplate();
View Full Code Here

  public void test() throws Exception {
    JobRepository jobRepository = new MapJobRepositoryFactoryBean().getObject();
    StepExecution execution = jobRepository.createJobExecution("foo", new JobParameters()).createStepExecution(
        "step");
    jobRepository.add(execution);
    PlatformTransactionManager transactionManager = new ResourcelessTransactionManager();
    TaskletStepBuilder builder = new StepBuilder("step").repository(jobRepository)
        .transactionManager(transactionManager).tasklet(new Tasklet() {
          @Override
          public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext)
              throws Exception {
View Full Code Here

  @Test
  public void testListeners() throws Exception {
    JobRepository jobRepository = new MapJobRepositoryFactoryBean().getJobRepository();
    StepExecution execution = jobRepository.createJobExecution("foo", new JobParameters()).createStepExecution("step");
    jobRepository.add(execution);
    PlatformTransactionManager transactionManager = new ResourcelessTransactionManager();
    TaskletStepBuilder builder = new StepBuilder("step")
                       .repository(jobRepository)
                       .transactionManager(transactionManager)
                       .listener(new InterfaceBasedStepExecutionListener())
                       .listener(new AnnotationBasedStepExecutionListener())
View Full Code Here

  @Test
  public void testItemListeners() throws Exception {
    JobRepository jobRepository = new MapJobRepositoryFactoryBean().getJobRepository();
    StepExecution execution = jobRepository.createJobExecution("foo", new JobParameters()).createStepExecution("step");
    jobRepository.add(execution);
    PlatformTransactionManager transactionManager = new ResourcelessTransactionManager();

    List<String> items = new ArrayList<String>() {{
      add("1");
      add("2");
      add("3");
View Full Code Here

  public void setUp() {

    jobRepository = new SimpleJobRepository(new MapJobInstanceDao(), new MapJobExecutionDao(),
        new MapStepExecutionDao(), new MapExecutionContextDao());
    factory.setJobRepository(jobRepository);
    factory.setTransactionManager(new ResourcelessTransactionManager());
    factory.setBeanName("step");
    factory.setItemWriter(writer);
    factory.setCommitInterval(4);

    MessagingTemplate gateway = new MessagingTemplate();
View Full Code Here

  @Before
  public void setUp() throws Exception {
    factory.setBeanName("stepName");
    factory.setJobRepository(new JobRepositorySupport());
    factory.setTransactionManager(new ResourcelessTransactionManager());
    factory.setCommitInterval(2);
    factory.setItemReader(reader);
    factory.setItemWriter(writer);
    Map<Class<? extends Throwable>, Boolean> skippableExceptions = new HashMap<Class<? extends Throwable>, Boolean>();
    skippableExceptions.put(SkippableException.class, true);
View Full Code Here

    builder = new JsrSimpleStepBuilder<String, String>(new StepBuilder("step1"));
    builder.setBatchPropertyContext(new BatchPropertyContext());
    repository = new MapJobRepositoryFactoryBean().getObject();
    builder.repository(repository);
    builder.transactionManager(new ResourcelessTransactionManager());
    stepExecution = null;
  }
View Full Code Here

    factory.setItemReader(new ListItemReader<String>(
        new ArrayList<String>()));
    factory.setItemWriter(writer);
    factory.setJobRepository(repository);
    factory.setTransactionManager(new ResourcelessTransactionManager());
    factory.setRetryableExceptionClasses(getExceptionMap(Exception.class));
    factory.setCommitInterval(1); // trivial by default

    factory.setSkippableExceptionClasses(getExceptionMap(Exception.class));
View Full Code Here

TOP

Related Classes of org.springframework.batch.support.transaction.ResourcelessTransactionManager

Copyright © 2018 www.massapicom. 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.