How to avoid this very heavy query that slows down the application?

前端 未结 9 727
日久生厌
日久生厌 2021-01-05 18:56

We have a web application running in a production enviroment and at some point the client complained about how slow the application got.

When we checked what was goi

9条回答
  •  盖世英雄少女心
    2021-01-05 19:07

    As pointed out by @BalusC, this query is performed during schema validation. But validation is usually done once for all when creating the SessionFactory (if activated). Do you call the following method explicitely: Configuration#validateSchema(Dialect, DatabaseMetadata)?


    Now, is that correct? It's there a way for me to configure the OC4J for it to instantiate filters only once?

    Your implementation of the Open Session In View looks fine (and is very close to the one suggested in this page). And according to the Servlet specification only one instance per declaration in the deployment descriptor is instantiated per Java Virtual Machine (JVMTM) of the container. Since it is very unlikely that this isn't the case with OC4J, I'm tempted to say that there must something else.

    Can you put some logging in the filter? What about making the SessionFactory static (in a good old HibernateUtil class)?

提交回复
热议问题