• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Spring Boot Rest API - DB connection issue

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a spring boot rest API set up that accepts JSON data and does some database operations with the values.  I am running into an issue where every so often, the web service produces the following error:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Like I said, it does not happen all of the time.  I can get it to happen via postman when I send a successful request and then wait a couple of minutes and try to send another request, it throws the error.  But when i send another immediate request after the error, it works fine.  Is this a database settings issue?  I've tried a lot of different tomcat settings like the following in my yaml file:

datasource:
   tomcat:
     initial-size: 15
     max-active: 200
     max-idle: 30
     max-wait: 20000
     min-idle: 89
     testWhileIdle: true
     timeBetweenEvictionRunsMillis: 60000
     validation-query: SELECT 1
     validation-interval: 34000
     test-on-borrow: true
     remove-abandoned: true
     remove-abandoned-timeout: 55
     default-auto-commit: true

Thank you in advance for the help.
 
reply
    Bookmark Topic Watch Topic
  • New Topic