I'm using c3p0 (+Hibernate 3.6) in my application (since 2007).
c3p0: current version
Oracle JDBC driver (version Oracle 10, afair).
Is it possible to tell c3p0 to empty its prepared statement cache?
Explanation why I want to (sometimes) empty c3p0 prepared statement cache:
My application is a batch application which runs about 10 different processing phases (one phase after another - not concurrently). Every phase using completely other set of queries toward database.
I have found in the memory dump viewer that some prepared statements allocates very big arrays. Finally I have found that (at least for Oracle JDBC drivers which i am using) those very large arrays are related to queries like this (Hibernate piece of code):
Query q = session
I have realized that those values in setFetchSize method call are responsible for those very large arrays in application memory.
Currently I have reduced those values in setFetchSize but I want to increase them in the future. But to avoid OutOfMemoryError I would like to know hot to empty c3p0 prepared statement cache programmatically to free memory related to prepared statements with large setFetchSize setting (in my case I would like to empty prepared statement cache, for example, after every processing phase).
Log in to post a comment.