Results 1 to 6 of 6

Thread: Spring batch- meta data schema

  1. #1

    Default Spring batch- meta data schema

    Hello All,

    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?
    BATCH_STEP_EXECUTION
    BATCH_EXECUTION_CONTEXT
    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.

    Thanks
    Krishna

  2. #2
    Join Date
    Feb 2008
    Posts
    488

    Default

    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.

  3. #3

    Default

    Hi,
    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.
    Thanks
    Krishna

  4. #4
    Join Date
    Feb 2008
    Posts
    488

    Default

    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).

  5. #5
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    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?

  6. #6

    Default

    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
    b_exec_context.
    Its appearing like working fine, and a simple job got executed succesfully.
    If there are any side effects, please let me know.

    Thanks
    Krishna.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •