I\'m using the tomcat connection pool via JNDI resources.
In the context.xml
:
The connection pool does not have anything to do with data caching (unless you specifically configure it that way). It's best practice to use a connection pool for database access to prevent runaway connections (e.g. hitting the database with too many simultaneous connections) and to reuse connections that have been opened once (typically establishing a connection is quite expensive, thus they get utilized again). You'll also want the statements themselves (as PreparedStatement
) to be cached, as the next expensive operation for a database is to determine the execution plan. (This is independent of the actual result caching)
Have you analyzed if your cached data actually comes from mysql or if you're caching on application level?
Also, make sure that your insert
& update
transactions are actually committed, otherwise there obviously won't be any change and the data looks like it's cached.