title: SpringBoot+JDBCTemplate+Parent Key not found error
body: <p>Unable to insert into child table in a single transaction using springboot and jdbctemplate.</p>
  <h3>Controller:</h3>
  <pre><code>@RequestMapping(value = &quot;/addUser&quot;, method = RequestMethod.POST)
  public Response addUser(@RequestBody UserVo userVo) throws Exception
  {
      service.addUserRecord(userVo);
  }
  </code></pre>
  <h3>Service Layer:</h3>
  <pre><code>@Autowired
      private Dao dao;
  
  
  @Transactional(readOnly = false)
  public void addUserRecord(@RequestBody UserVo userVo) throws Exception
  {
      int parentSeqNo = dao.addUser();
      int result = dao.addUserDetails(parentSeqNo, list);  
  }
  </code></pre>
  <h3>DAOImple class:</h3>
  <pre><code>@Autowired
  private JdbcTemplate jdbcTemplate;
  
  public int addUser()
  {
      try
      {
        String sql = &quot;INSERT INTO user_table()  VALUES (?,?,?,?,?) &quot;;
        jdbcTemplate.update(sql,....);
        return seqNo;
      }
      catch(Exception e)
      {
          e.printStackTrace();
          throw e;
      }
  }
      
  public void addUserDetails(String seqNo, List&lt;String&gt; list){
           
      String sql=&quot;insert into user_details_table values(?,?)&quot;;
           
      jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {
          public void setValues(PreparedStatement ps, int i) throws SQLException {
              String img = list.get(i);
              ps.setString(1, seqNo);
              ps.setString(2, img);
                  
          }
  
          public int getBatchSize() {
              return list.size();
          }
      });
            
      return;
            
  }
  </code></pre>
  <h3>Issue/Error:</h3>
  <blockquote>
  <p>ORA-02291: integrity constraint (FK3) violated - parent key not found; nested exception is java.sql.SQLIntegrityConstraintViolationException:</p>
  </blockquote>
  <p>Database tables and constraints are looks good and tried to insert using sql editor, just working fine.  While testing from postman tool, getting parent key not found exception.  Greatly appreciated for any suggestions on this issue.</p>