Results 1 to 2 of 2

Thread: Using SampleJdbcTemple in the spring batch

  1. #1
    Join Date
    Apr 2011
    Posts
    5

    Default Using SampleJdbcTemple in the spring batch

    Hi,
    we are using the SampleJdbcTemple (in processor) in our spring batch application. it process million of records , so it taking more time for the database operation, so we looking some other alternative connect the database. give me suggestion to overcome the issue??

    application structure
    ===============
    reader----->processor( using the SampleJdbcTemple for querying) ------>writer




    doubts:
    ======

    1. we are processing million of records , so for each record it hits the database. Is SampleJdbcTemple leads to open and close the connection for each record or ??, If it Yes, how to manage it??

    2. Is it there connection pooling in spring batch?, If Yes, how to configure and implement that??
    Last edited by daggoluAnil; Sep 22nd, 2011 at 04:46 AM.

  2. #2

    Default

    it depends a lot on the used sql but generally its a good practice to combine all necessary sql in one and use it for the reader as one "cursor", at least run all used sql through some dba and/or use explain to find problems (read: missing indices and such)

    1. we are processing million of records , so for each record it hits the database. Is SampleJdbcTemple leads to open and close the connection for each record or ??, If it Yes, how to manage it??
    you just use the query methods, connections are handled by the template

    2. Is it there connection pooling in spring batch?, If Yes, how to configure and implement that??
    no it is not, for connections and connection pooling you configure the datasource and either get it from the container (EE) or use something like c3p0

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
  •