spring-batch

Spring Batch JdbcPagingItemReader seems not paginating

回眸只為那壹抹淺笑 提交于 2019-12-06 16:53:11
I'm working on an app that indexes a bunch of files in an embedded Derby(10.12.1.1) DB and then are exported as one single tabulated file. The first part is working fine since the DB is created and all records are indexed. However, when I attempt to read from the DB using JdbcPagingItemReader and write to a file I only get the number of records specified in pageSize . So if the pageSize is 10, then I get a file with 10 lines and the rest of the records seem to be ignored. So far, I haven't been able to find whats is really going on and any help would be most welcome. Here is the

Hibernate batch insert, batch update

主宰稳场 提交于 2019-12-06 16:26:16
问题 I have dao which basically inserts a record into a table using hibernate, this dao is marked by @Transactional annotation with propogation-NESTED , and I have service which makes some other stuff and then invokes my dao. My service is also annotated with @Transactional with propagation-REQUIRED . I call service in a loop. Does my inserts on my dao works in batch or one by one? How can I be sure that they work in batch? Does hibernateTransaction manager manage batch inserts? I am using Oracle

Is it possible to integrate Apache Solr with Spring Batch?

时光总嘲笑我的痴心妄想 提交于 2019-12-06 15:39:01
I read about Apache Solr and Spring Batch. Apache Solr is powerful search technology. Now, we want to read data from Apache Solr and then Spring Batch will process that data and will write to database. I searched a lot, but I could not get demo about this integrartion. Is it possible to integrate Apache Solr with Spring Batch? We have done a spring batch based application that do indexing on solr cloud which is equivalent to Solr "Data Import Request Handler". Step 1: Read from database <bean id="itemReader" class="org.springframework.batch.item.database.JdbcPagingItemReader" scope="step">

batch admin console - DispatcherServlet using InternalResourceViewResolver instead of FreeMarkerViewResolver

限于喜欢 提交于 2019-12-06 15:28:46
I have an issue with integrating the spring batch admin console into my application. The good news is that when i go to http://mymachine.com:8080/ReportingManager/batch/configuration I can get to the admin console. But when I go to http://mymachine.com:8080/ReportingManager/batch/job-configuration i get a 404 and an error saying that /batch/jobs can't be found. I've just gone through the exercise of comparing the difference in output of org.springframework.web logs between my application logs and the spring-batch-admin-sample application which I know is working. After looking at the logs it

Caused by: java.lang.IllegalArgumentException: Unable to deserialize the execution context in Spring Batch

一曲冷凌霜 提交于 2019-12-06 15:27:22
I am developing Spring Boot + Batch XML based approach. In this example, I have created following classes. When I simply load or class the Spring Batch Job. I get the below error. I web search links like : Migration to Spring Boot 2 and using Spring Batch 4 , but it did not solve my problem. Could anyone please guide what exact solution needs to be applied here ? Error: Caused by: java.lang.IllegalArgumentException: Unable to deserialize the execution context at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao$ExecutionContextRowMapper.mapRow(JdbcExecutionContextDao.java

java.lang.NoSuchMethodError: org.hibernate.SessionFactory.getCurrentSession()Lorg/hibernate/Session;

喜夏-厌秋 提交于 2019-12-06 14:09:56
问题 I'm trying to integrate a batch with my application i'm using hibernate-core-3.6.3 and hibernate-hibernate-commons-annotations-3.2.0 and spring-batch-core-3.0.1 And when I try to insert into the database when I run the batch this error appears. Here is my spring-batch-context <beans xmlns="http://www.springframework.org/schema/beans" xmlns:batch="http://www.springframework.org/schema/batch" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework

Unable to restart a Spring batch job

与世无争的帅哥 提交于 2019-12-06 12:31:27
问题 I have a spring batch job which reads, transforms and writes to an Oracle database. I am running the job via the CommandLineJobRunner utility (using a fat jar + dependencies generated with the maven shade plugin); the job subsequently fails halfway through due to "java heap memory limit reached" and the job is not marked as FAILED but rather still shows status STARTED. I tried to re-run the job using the same job parameters (as the docs suggest) but this gives me this error: 5:24:34.147 [main

Table Lock happens for spring batch chunk item reader and writer

。_饼干妹妹 提交于 2019-12-06 11:24:49
问题 I am working with the spring batch data loader . I have 15000 files and processing only one file using multiresource partitioner.It seems that the table lock happens when trying to insert data in to the table.There is no parallel step defined here. it is very slow for file processing. Following is the code snippet for chunk item reader and writer and the sql output for table lock. Spring config file <step id="filestep" xmlns="http://www.springframework.org/schema/batch" > <tasklet allow-start

@StepScope within Spring batch throw exception when trying pass param

不打扰是莪最后的温柔 提交于 2019-12-06 11:04:31
问题 I am having hard time to combine Spring-batch with Spring-batch-admin using Spring-boot. Because I am using Spring-batch-admin I had to disable @EnableBatchProcessing and I manually configured the two builders it provides. that came from my question here: Error Integrating spring-batch and Spring-Batch-admin Now I am trying to do simple scenario when I want to pass param from jobContext params into ItemReader using @StepScope and injection of the properties I followed the example over here

Spring Batch Paging with sortKeys and parameter values

十年热恋 提交于 2019-12-06 10:45:24
问题 I have a Spring Batch project running in Spring Boot that is working perfectly fine. For my reader I'm using JdbcPagingItemReader with a MySqlPagingQueryProvider. @Bean public ItemReader<Person> reader(DataSource dataSource) { MySqlPagingQueryProvider provider = new MySqlPagingQueryProvider() provider.setSelectClause(ScoringConstants.SCORING_SELECT_STATEMENT) provider.setFromClause(ScoringConstants.SCORING_FROM_CLAUSE) provider.setSortKeys("p.id": Order.ASCENDING) JdbcPagingItemReader<Person>