-
Jan 15th, 2011, 10:59 PM
#11
yes , It is using the same repository .
-
Jan 17th, 2011, 03:08 AM
#12
I am using my own transaction manger , does it have any role in not stoping the Job .
Transaction manger doesn't check any thing specific .
Below is the config for that
<bean id="transactionManager" class="com.real.ramses.ingestor.transformer.Ingest orTransactionManager" />
<bean id="jobRepository" class="org.springframework.batch.core.repository.s upport.MapJobRepositoryFactoryBean">
<property name="transactionManager" ref="transactionManager"/>
</bean>
-
Jan 17th, 2011, 06:42 AM
#13
Ah. Well it's not the transaction manager as such, but the repository is a problem. If you use a Map JobRepository, how do you expect it to be shared between the two processes (the one that launches it and the one that stops it)? You can still call JobExecution.stop() on the original running instance if you keep a reference to it, but using CommandLineJobRunner you will always be in a new process, so there is no way to exchange data without an external JobRepository.
-
Jan 19th, 2011, 12:02 AM
#14
thanks , I was trying to find the example which has used external repository , I Haven't found any , All of the examples use either MapRepository or simpleJob Repository .
If you can point me to any of the examples which uses external Repository , That will help me a lot .
thanks
-
Jan 19th, 2011, 06:25 AM
#15
I am trying External repo as DERBY Db ,
I have created tables and the tables required for sequece in derby .
But getting below error once i start a job , Is their any particular steps i need to follow ?
[mmandLineJobRunner.main()] ERROR CommandLineJobRunner - Job Terminated in error: Could not obtain IDENTITY value; nested exception is java.sql.SQLSyntaxErrorException: 'DUMMY' is not a column in table or VTI 'APP.BATCH_JOB_SEQ'.
-
Jan 24th, 2011, 10:37 AM
#16
You need to set up the database with the correct tables. There are scripts in the core jar file.
I wouldn't recommend Derby for production use, and you may see strange behaviour with pagination.
-
Feb 20th, 2011, 11:03 PM
#17
Dave ,
I Started using Mysql as my DB , Created all the tables required started job using the below command .
mvn exec:java -Dexec.mainClass=org.springframework.batch.core.lau nch.support.CommandLineJobRunner -Dexec.args="ingestor-config.xml job run.id=11"
After some time i wanted to stop my job , I used below command to stop
mvn exec:java -Dexec.mainClass=org.springframework.batch.core.lau nch.support.CommandLineJobRunner -stop -Dexec.args="ingestor-config.xml job run.id=11"
JOb didn't stop it was still running , is it not possible to stop a job using this command ?\
Exact Error :
2011-02-21 15:16:02,454 [mmandLineJobRunner.main()] ERROR CommandLineJobRunner - Job Terminated in error: A job execution for this job is already running: JobInstance: id=10, JobParameters=[{run.id=11}], Job=[job]
org.springframework.batch.core.repository.JobExecu tionAlreadyRunningException: A job execution for this job is already running: JobInstance: id=10, JobParameters=[{run.id=11}], Job=[job]
Last edited by didilip; Feb 21st, 2011 at 03:47 AM.
-
Feb 22nd, 2011, 11:41 AM
#18
I think there's a typo in your command line (-stop should be in the arguments to the main method). Does that fix it?
-
Feb 23rd, 2011, 03:11 AM
#19
did you mean like
mvn exec:java -Dexec.mainClass=org.springframework.batch.core.lau nch.support.CommandLineJobRunner -stop -Dexec.args="ingestor-config.xml job run.id=11 -stop"
or
vn exec:java -Dexec.mainClass=org.springframework.batch.core.lau nch.support.CommandLineJobRunner -Dexec.args="ingestor-config.xml job -stop run.id=11"
if yes , These commads are n ot stoping the job , instead throwing the same error as shown above .
thanks
-
Feb 23rd, 2011, 03:55 AM
#20
That's what I meant (either should work). What version of Spring Batch are you using?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules