Feb 2nd, 2009, 04:01 PM
Spring batch- meta data schema
I'm new to spring batch. I'm trying to execute a sample spring batch application in db2 environment. The problem I have in the moment is that,
Spring batch framework is creating 6 tables automatically (Meta data) for internal purposes to track the status of each and every job.
Our db2 is not accepting table names beyond 18 characters. Do we have control to change the following table’s names?
If I change the above table names from schema-db2.sql of spring core component, what would be the side effects?
Your early response is highly appreciated.
Feb 2nd, 2009, 06:08 PM
You can change the table's prefix (by default, it's "BATCH_") using the "tablePrefix" attribute of the JobRepositoryFactoryBean, but it is not possible to change anything else.
Feb 3rd, 2009, 09:56 AM
Thanks for your prompt response.
As you said, I understand that, we can change the prefix.
However it doesn't help to restrict the table name to 18 characters.
Is there any way that I can get rid of these tables from framework?
I understand that, frame work is using these tables, to update the batch processing status, but if there is a way to get rid of this part, I Can still use spring batch for my project. Other wise, I have to go for new option.
Your response is appreciated.
Feb 3rd, 2009, 10:03 AM
Another option is to use the MapJobRepositoryFactoryBean instead of the JobRepositoryFactoryBean. This will store the meta-data in an in-memory Map instead of in a database. This will fix your problem, but probably won't work if you do indeed need that meta data later (for instance, for restarting jobs).
Feb 3rd, 2009, 12:28 PM
I think the longest table name in 1.1.x is BATCH_EXECUTION_CONTEXT, so I calculate that a prefix of length less than 2 works. Where does the 18 char limit come from? What db2 version is that?
Feb 3rd, 2009, 02:07 PM
Thanks guys, for your prompt responses.
I modifed the program JDBCExecutionContext.java, and changed the table name to
PREFIX%EXEC_CONTEXT with b_as a prefix.
I didn't find any side effects from this and crEated the table as
Its appearing like working fine, and a simple job got executed succesfully.
If there are any side effects, please let me know.