Results 1 to 3 of 3

Thread: How to integrate ehcache?

  1. #1

    Question How to integrate ehcache?

    Hi,

    Greetings!

    I've an ETL process where in I need to read CSVs and transform them based on lookups in the cache before loading to the data warehouse. In my existing ETL application I would prime the cache at the application start and use it later.

    I'm finding it difficult to initialize the cache before the transformation step starts with Spring Batch.

    After reading the documentation there is a way in which I think I can achieve this but not sure;
    1. In a separate step before the transformation step I can read from database to populate the cache and then finally store the reference to CacheManager to step execution context which may later be retrieved as per the documentation (refer #11.8)

    However, I'm not sure if this is the right way to achieve this. Further, I'm also not sure how to 'promote' step execution context to job execution mentioned in the same section.

    Any help is appreciated. Thanks again.

    Regards,
    Nitin

  2. #2
    Join Date
    Dec 2005
    Location
    Lyon, France
    Posts
    311

    Default

    you can indeed use a first step to initialize your cache. You don't have to put the CacheManager in the execution context, you can use dependency injection (inject the CacheManager where you need it, in item readers, processors, etc.)

    be careful not to store too many things in memory though.

  3. #3

    Default

    Thanks! I figured that out a few days back.. the answer was blowing in the wind!!

Tags for this Thread

Posting Permissions

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