I support a web application written in java on top of hibernate (version 3.5.2-Final). In some of our customer's environments, they're using ojdbc 1.6 and connecting to Oracle 11G r2. At undpredictable times, the application will send a gargantuan join to the DB that will crush the server (please see below).
I can't figure out what part of our web application is responsible for the query. I'd like to know how to prevent this from happening. Would this config parameter help (found in google searching- hoping not misapplied)?
Code:
sessionFactory.hibernateProperties.hibernate.max_fetch_depth=1
Appreciatively,
mtf
Code:
select count(distinct certificat0_.id) as col_0_0_
from xyz_certification certificat0_ left outer join xyz_certifiers certifiers1_ on certificat0_.id=certifiers1_.certification_id left outer join xyz_certifiers certifiers2_ on certificat0_.id=certifiers2_.certification_id left outer join xyz_certifiers certifiers3_ on certificat0_.id=certifiers3_.certification_id left outer join xyz_certifiers certifiers4_ on certificat0_.id=certifiers4_.certification_id left outer join xyz_certifiers certifiers5_ on certificat0_.id=certifiers5_.certification_id left outer join xyz_certifiers certifiers6_ on certificat0_.id=certifiers6_.certification_id left outer join xyz_certifiers certifiers7_ on certificat0_.id=certifiers7_.certification_id left outer join xyz_certifiers certifiers8_ on certificat0_.id=certifiers8_.certification_id left outer join xyz_certifiers certifiers9_ on certificat0_.id=certifiers9_.certification_id left outer join xyz_certifiers certifiers10_ on certificat0_.id=certifiers10_.certification_id left outer join xyz_certifiers certifiers11_ on certificat0_.id=certifiers11_.certification_id left outer join xyz_certifiers certifiers12_ on certificat0_.id=certifiers12_.certification_id left outer join xyz_certifiers certifiers13_ on certificat0_.id=certifiers13_.certification_id left outer join xyz_certifiers certifiers14_ on certificat0_.id=certifiers14_.certification_id left outer join xyz_certifiers certifiers15_ on certificat0_.id=certifiers15_.certification_id left outer join xyz_certifiers certifiers16_ on certificat0_.id=certifiers16_.certification_id left outer join xyz_certifiers certifiers17_ on certificat0_.id=certifiers17_.certification_id left outer join xyz_certifiers certifiers18_ on certificat0_.id=certifiers18_.certification_id left outer join xyz_certifiers certifiers19_ on certificat0_.id=certifiers19_.certification_id left outer join xyz_certifiers certifiers20_ on certificat0_.id=certifiers20_.certification_id left outer join xyz_certifiers certifiers21_ on certificat0_.id=certifiers21_.certification_id left outer join xyz_certifiers certifiers22_ on certificat0_.id=certifiers22_.certification_id left outer join xyz_certifiers certifiers23_ on certificat0_.id=certifiers23_.certification_id left outer join xyz_certifiers certifiers24_ on certificat0_.id=certifiers24_.certification_id left outer join xyz_certifiers certifiers25_ on certificat0_.id=certifiers25_.certification_id left outer join xyz_certifiers certifiers26_ on certificat0_.id=certifiers26_.certification_id left outer join xyz_certifiers certifiers27_ on certificat0_.id=certifiers27_.certification_id left outer join xyz_certifiers certifiers28_ on certificat0_.id=certifiers28_.certification_id left outer join xyz_certifiers certifiers29_ on certificat0_.id=certifiers29_.certification_id left outer join xyz_certifiers certifiers30_ on certificat0_.id=certifiers30_.certification_id left outer join xyz_certifiers certifiers31_ on certificat0_.id=certifiers31_.certification_id left outer join xyz_certifiers certifiers32_ on certificat0_.id=certifiers32_.certification_id left outer join xyz_certifiers certifiers33_ on certificat0_.id=certifiers33_.certification_id left outer join xyz_certifiers certifiers34_ on certificat0_.id=certifiers34_.certification_id left outer join xyz_certifiers certifiers35_ on certificat0_.id=certifiers35_.certification_id left outer join xyz_certifiers certifiers36_ on certificat0_.id=certifiers36_.certification_id left outer join xyz_certifiers certifiers37_ on certificat0_.id=certifiers37_.certification_id left outer join xyz_certifiers certifiers38_ on certificat0_.id=certifiers38_.certification_id
where (certificat0_.phase is not null) and (certifiers1_.certifier=:1 or certifiers2_.certifier=:2 or certifiers3_.certifier=:3 or certifiers4_.certifier=:4 or certifiers5_.certifier=:5 or certifiers6_.certifier=:6 or certifiers7_.certifier=:7 or certifiers8_.certifier=:8 or certifiers9_.certifier=:9 or certifiers10_.certifier=:10 or certifiers11_.certifier=:11 or certifiers12_.certifier=:12 or certifiers13_.certifier=:13 or certifiers14_.certifier=:14 or certifiers15_.certifier=:15 or certifiers16_.certifier=:16 or certifiers17_.certifier=:17 or certifiers18_.certifier=:18 or certifiers19_.certifier=:19 or certifiers20_.certifier=:20 or certifiers21_.certifier=:21 or certifiers22_.certifier=:22 or certifiers23_.certifier=:23 or certifiers24_.certifier=:24 or certifiers25_.certifier=:25 or certifiers26_.certifier=:26 or certifiers27_.certifier=:27 or certifiers28_.certifier=:28 or certifiers29_.certifier=:29 or certifiers30_.certifier=:30 or certifiers31_.certifier=:31 or certifiers32_.certifier=:32 or certifiers33_.certifier=:33 or certifiers34_.certifier=:34 or certifiers35_.certifier=:35 or certifiers36_.certifier=:36 or certifiers37_.certifier=:37 or certifiers38_.certifier=:38 ) and certificat0_.phase<>:39