OiO.lk Blog java mysql table locks failing tomcat connection pooling and http
java

mysql table locks failing tomcat connection pooling and http


I need to execute the below commands though mysql scheduler to refresh the full-text indexes in a table –

ALTER TABLE some_table DROP INDEX full_text;
ALTER TABLE some_table ADD FULLTEXT INDEX full_text (description) VISIBLE;

But this locks down the table which does not quite fails the tomcat 9.0 connection pooling but the entire http requests fails across all the web projects deployed. I can see in the tomcat logs the background queries to the connection pool works just fine.

I have to restart the tomcat server after which everything works fine.

the connection pool string –

<Resource name="myDatasource" auth="Container" type="javax.sql.DataSource"
maxTotal="100" maxIdle="30" maxWaitMillis="10000" username="username" password="password" 
driverClassName="com.mysql.cj.jdbc.Driver"
url="jdbc:mysql://localhost:3306/mydb?useOldAliasMetadataBehavior=true"/>

I have another simple mysql connection below which never fails although –

if(con1 == null || con1.isClosed()) {
      Class.forName("com.mysql.cj.jdbc.Driver");
      con1=DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb","username","password");
}



You need to sign in to view this answers

Exit mobile version