Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've had the very same scenario (in a slightly different setting). I was not going for JdbcTemplate but for MappingSQLQuery. I think, at least for the query it better suited my needs. Given you would be willing to change, the code could look like this</p> <pre><code>MappingSQLQuery selector = ...; executor.execute(new Runnable() { public void run() { List&lt;WrapObject&gt; list = selector.execute(); for (WrapObject object : list) { while (!queue.offer(object)) { Thread.sleep(100); } } while (!queue.offer(WrapObject.NULL_OBJECT)) { Thread.sleep(100); } } }); executor.execute(new Runnable() { public void run() { WrapObject object; while ((object = queue.take) != WrapObject.NULL_OBJECT) { outboundJdbcTemplate.update(INSERT_QUERY, object.getParam1(),...) } } }); </code></pre> <p>Given a suitable definition of WrapObject, this should do the trick. </p> <p>Working a lot with performance-critical DB-Systems I found the following two things.</p> <ol> <li><p>Often, reimplementing the Spring mappers gives you a better control over the things happening to the database (especially batch-updates, compile-time of PreparedStatements, setting batch-sizes)</p></li> <li><p>If you take a peek at the code, you will learn, that the part of the over-generic Spring-JDBC classes relevant to you is mostly some 10-20 lines and easily reimplemented for your sepcific case while speeding up your application significantly</p></li> <li><p>Depending on your database you might wish to use more than one reader/writer. I have worked with Oracle-Clusters where eight parallel read-processes don't even start to put a significant load on the hardware</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload