0

I have a java web application deployed in glassfish. This application interacts with Mariadb server. Suddenly, the app stops working. I'm checking the app.log and glassfish server log and I have the following results:

app.log

Could not open JDBC Connection for transaction; nested exception is java.sql.SQLNonTransientConnectionException: Could not send query: Last packet not finished

server.log

### The error may exist in file [/opt/glassfish3/glassfish/domains/domain1/applications/exampleApp/WEB-INF/class/model/xml/ParameterMapper.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT NOW();
### Cause: java.sql.SQLNonTransientConnectionException: Could not send query: Last packet not finished
; SQL []; Could not send query: Last packet not finished; nested exception is java.sql.SQLNonTransientConnectionException: Could not send query: Last packet not finished|#]

The application repeats same database operations every 5 minutes.

I tried to reload the application by glassfish but it didn't work. The only way is restarting the server and it works but not for long.

What is happening for this case? or What can I do?

user3637971
  • 155
  • 2
  • 11

1 Answers1

0

I got the answer. What I did is changing wait_timeout parameter in server.cnf. The value was 30 and I changed to its default value 28800. It could be set lower than 28800 but that's another issue. What happened was the java app executed several insert operations every 5 minutes so the connection was closed by Mariadb server because of wait_timeout. I'm wondering the DB connection was singleton and the app was not validating if the connection was closed.

user3637971
  • 155
  • 2
  • 11