Oracle uses a lot of memory for prepared statements (which c3p0 is caching), so I'm investigating why I have so many. It turns out they're of the form:
Code:
select p0_.R_ID as R4_28_1, ...
from P p0_
where p0_.R_ID in (?, ?, ?, ?, ?, ?, ?) /* varying number of arguments */
I have many such prepared queries, with varying numbers of question marks.
Is there any way to configure Hibernate to always use the same queries? How have other people worked around this?
Thanks!
For those curious, I took a heap dump with jmap and used Eclipse MAT with the following OQL to get at this.
Code:
SELECT objects s.sqlObject.odbc_sql.value
FROM oracle.jdbc.driver.T4CPreparedStatement s WHERE (s.@retainedHeapSize > 1000000)