Announcement Announcement Module
Collapse
No announcement yet.
Using SampleJdbcTemple in the spring batch Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 04:46 AM.

  • #2
    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

    Comment

    Working...
    X