Did you get the solution to thids problem. I am also facing the same issue and it looks there is no other workaround except migrating my EJB 2.1 entities to EJB3.0
we didn't really find a configurable solution, with parameters for cache size and expiry,
but browsing through the source revealed that there is indeed, a default cache policy in effect.
The relevant parts of the source code are:
The cache implementations are based on ConcurrentHashMaps, and appeared to have no configuration options or
documentation (please correct me if I am worng, I haven't checked for recent improvements). So we adviced our
client to test further with the default cache, and heard of no more problems.
I would be interested in hearing of your experiences with the default EJB2 entity cache, particularly if you run into resource stress,
if the cache is unconstrained.
I browsed through the JBOSS code it seems that these files are only caching entity instances which can be reused to service new requests from the pool.
I will check in Jprofiler JDBC console whether it is actually doing any caching of JDBC calls.
Thanks for response and I will update you with the results.