title: REST API call returning 400 even if code is not having error
body: <p><a href="https://i.stack.imgur.com/LFkRm.jpg" rel="nofollow noreferrer">Image showing error from API</a>I made one rest API that is manipulating a file and then uploading the file to third party and then it will have two database operations. First one is select and the second one is insert. </p>
  
  <p>In few cases , I am getting 200 but in some cases I am getting 400. Now, when I am getting 400, the control is only coming till select method and there is no error in that method.</p>
  
  <p>So, it looks like request is getting timeout or something. Can anyone please suggest the proper way to do it? Where should I change the timeout?</p>
  
  <p><strong>Success logs</strong>- [2019-04-11 10:09:26] [T] [http-nio-10.0.0.219-7000-exec-11] [Controller]  DOCUMENT UPLOADED IN Folder
  [2019-04-11 10:09:26] [T] [http-nio-10.0.0.219-7000-exec-11] [Controller] Checking if transition is valid from new NEW status -  initiated
  [2019-04-11 10:09:26] [T] [http-nio-10.0.0.219-7000-exec-11] [Controller] CALLING FUNCTION TO SAVE RESPONSE IN DIGIO_RESPONSES IN DB
  [2019-04-11 10:10:11] [T] [http-nio-10.0.0.219-7000-exec-14] [Controller] [LFT] [userId = 12] POST 200 /storage/upload</p>
  
  <p><strong>FAILURE logs</strong>- 2019-04-11 10:10:11] [T] [http-nio-10.0.0.219-7000-exec-14] [Controller]  DOCUMENT UPLOADED IN Folder
  [2019-04-11 10:10:11] [T] [http-nio-10.0.0.219-7000-exec-14] [Controller] Checking if transition is valid from new NEW status -  initiated
  [2019-04-11 10:10:11] [T] [http-nio-10.0.0.219-7000-exec-14] [Controller] [LFT] [userId = 12] POST 400 /storage/upload</p>