-1

I want java code for Shopware API call to clear all cache. Please help

1 Answers1

0

You are already using a connection pool (assuming you are using org.apache.commons.dbcp.BasicDataSource or from dbcp2), the real problem is that you are creating a static Connection and only ever return that one connection.

Don't do that, remove the static field connection, make sure you create the data source once and assign it to a static field, and in getConn call getConnection on the data source unconditionally.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197