aspose file tools*
The moose likes Spring and the fly likes Spring Batch Job Repository with sybase database. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring Batch Job Repository with sybase database." Watch "Spring Batch Job Repository with sybase database." New topic
Author

Spring Batch Job Repository with sybase database.

Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Dear all,

I am using the spring batch 2.1.9. The jobRepository is setup using the sybase database. Everything is running fine. But while creation of job-ids the job ids are not in sequential manner. Every day the sequence is prefixes with different number and generating the job ids from one. I want the behaviour to start the sequenece number from 1 and continues by incrementing by 1 for every new job.

Is any setting at xml configuration level or database level needs to change ?

The job repository is defined as


and the sequence table definition from jar is



Thanks




Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

Every day the sequence is prefixes with different number and generating the job ids from one.

Could you provide an example of the job-id's being generated. Where are you seeing these different id's? In the Job_Instance_Table?

I want the behaviour to start the sequenece number from 1 and continues by incrementing by 1 for every new job.

This is supposed to be the default behavior. It should work that way out of the box

Is any setting at xml configuration level or database level needs to change ?

Your config looks fine.


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

Found the problem. The sybase database is running in development environment and shut down everyday. There is identity gap due to this.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring Batch Job Repository with sybase database.
 
Similar Threads
Running a batch
Help with Spring Batch (Newbie)
Spring batch 2.1.8 jobRepository creation problem
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException
spring batch threads not returning after execution of main thread is complete