xml2008
Aug 19th, 2007, 11:07 AM
I managed to test the tradeJob sample in my own web application, but I run into
following problems:
1. All the *_SEQ tables are not initialized, so I must do it myself. By the way, I am using MySQL.
CREATE TABLE BATCH_STEP_EXECUTION_SEQ (
ID BIGINT
);
CREATE TABLE BATCH_STEP_SEQ (
ID BIGINT
);
CREATE TABLE BATCH_JOB_EXECUTION_SEQ (
ID BIGINT
);
CREATE TABLE BATCH_JOB_SEQ (
ID BIGINT
);
INSERT INTO BATCH_STEP_EXECUTION_SEQ (id) VALUES (1);
INSERT INTO BATCH_STEP_SEQ (id) VALUES (1);
INSERT INTO BATCH_JOB_EXECUTION_SEQ (id) VALUES (1);
INSERT INTO BATCH_JOB_SEQ (id) VALUES (1);
2. I am using an HTTP request to start the configured tradeJob sample. When I start the tradeJob the second time, the "source" reference (fileInputTemplate) in org.springframework.batch.execution.tasklet.suppor t.DefaultFlatFileItemProvider
is at the end of the file, so there is no object returned from method:
public final Object next().
I guess there should be a call of SimpleFlatFileInputSource.close() somewhere.
Is that by design or how can I go around this problem?
<bean id="jobConfiguration" parent="simpleJob">
<property name="name" value="tradeJob" />
<property name="steps">
<list>
<bean id="step1" parent="simpleStep">
<constructor-arg>
<bean class="org.springframework.batch.execution.tasklet.Restar tableItemProviderTasklet">
<property name="itemProvider">
<bean
class="org.springframework.batch.execution.tasklet.suppor t.DefaultFlatFileItemProvider">
<property name="source" ref="fileInputTemplate" />
<property name="mapper">
<bean class="org.springframework.batch.sample.mapping.TradeFiel dSetMapper" />
</property>
<property name="validator" ref="tradeValidator" />
</bean>
</property>
<property name="itemProcessor">
<bean class="org.springframework.batch.sample.module.process.Tr adeProcessor"
p:writer-ref="tradeDao" />
</property>
</bean>
</constructor-arg>
</bean>
following problems:
1. All the *_SEQ tables are not initialized, so I must do it myself. By the way, I am using MySQL.
CREATE TABLE BATCH_STEP_EXECUTION_SEQ (
ID BIGINT
);
CREATE TABLE BATCH_STEP_SEQ (
ID BIGINT
);
CREATE TABLE BATCH_JOB_EXECUTION_SEQ (
ID BIGINT
);
CREATE TABLE BATCH_JOB_SEQ (
ID BIGINT
);
INSERT INTO BATCH_STEP_EXECUTION_SEQ (id) VALUES (1);
INSERT INTO BATCH_STEP_SEQ (id) VALUES (1);
INSERT INTO BATCH_JOB_EXECUTION_SEQ (id) VALUES (1);
INSERT INTO BATCH_JOB_SEQ (id) VALUES (1);
2. I am using an HTTP request to start the configured tradeJob sample. When I start the tradeJob the second time, the "source" reference (fileInputTemplate) in org.springframework.batch.execution.tasklet.suppor t.DefaultFlatFileItemProvider
is at the end of the file, so there is no object returned from method:
public final Object next().
I guess there should be a call of SimpleFlatFileInputSource.close() somewhere.
Is that by design or how can I go around this problem?
<bean id="jobConfiguration" parent="simpleJob">
<property name="name" value="tradeJob" />
<property name="steps">
<list>
<bean id="step1" parent="simpleStep">
<constructor-arg>
<bean class="org.springframework.batch.execution.tasklet.Restar tableItemProviderTasklet">
<property name="itemProvider">
<bean
class="org.springframework.batch.execution.tasklet.suppor t.DefaultFlatFileItemProvider">
<property name="source" ref="fileInputTemplate" />
<property name="mapper">
<bean class="org.springframework.batch.sample.mapping.TradeFiel dSetMapper" />
</property>
<property name="validator" ref="tradeValidator" />
</bean>
</property>
<property name="itemProcessor">
<bean class="org.springframework.batch.sample.module.process.Tr adeProcessor"
p:writer-ref="tradeDao" />
</property>
</bean>
</constructor-arg>
</bean>