Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Rejected
    • Affects Version/s: 3.0 final
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:
      Hibernate 3.0 final
    • Last commented by a user?:
      true

      Description

      We have many named queries which delay to much to be loaded in app startup. So we sugest you to add a configuration parameter or an attribute in 'query' hibernate mapping tag which allow us to parse and load a named query only on demand. This becomes easier to test the application, since the startup time can be decreased with this feature.

        Activity

        Hide
        Gavin King added a comment -

        No, this would require extra synchronization in the core.

        Show
        Gavin King added a comment - No, this would require extra synchronization in the core.
        Hide
        Max Rydahl Andersen added a comment -

        btw. out of interest how many queries are we talking about ?

        In my performance investigations it has always been class mappings that where "bad", never query definitions.

        Have you though about trying to use addCachableFile ?

        and if your usecase is testing the application why don't you just only load the relevant mappings/queries in your test case ?

        Show
        Max Rydahl Andersen added a comment - btw. out of interest how many queries are we talking about ? In my performance investigations it has always been class mappings that where "bad", never query definitions. Have you though about trying to use addCachableFile ? and if your usecase is testing the application why don't you just only load the relevant mappings/queries in your test case ?
        Hide
        Regis Pires Magalhaes added a comment -

        > and if your usecase is testing the application why don't you just only > load the relevant mappings/queries in your test case ?

        We use about 600 named queries in our application. This avoids recompiling code when we just want to modify the queries.
        To load just relevant mapping we would have to manually add or remove the used queries. That was reason why we posted the suggestion.

        What is your opinion about using so many named queries?

        Show
        Regis Pires Magalhaes added a comment - > and if your usecase is testing the application why don't you just only > load the relevant mappings/queries in your test case ? We use about 600 named queries in our application. This avoids recompiling code when we just want to modify the queries. To load just relevant mapping we would have to manually add or remove the used queries. That was reason why we posted the suggestion. What is your opinion about using so many named queries?
        Hide
        Max Rydahl Andersen added a comment -

        No opinion - but 600 should really not hit you that much (i guess i'll have too see what takes so much time for that).

        And why can't you just load the relevant queries ? Should be good thing for unittesting to do anyway.

        Show
        Max Rydahl Andersen added a comment - No opinion - but 600 should really not hit you that much (i guess i'll have too see what takes so much time for that). And why can't you just load the relevant queries ? Should be good thing for unittesting to do anyway.
        Hide
        Max Rydahl Andersen added a comment -

        you do keep these named queries in separate files from the entities mappings correct ?

        Because if you don't i'm quite sure it is the amount of mapping entities that "hurts" you.

        in any respect you should look at addCacheableFile which will remove the xml parsing overhead

        Show
        Max Rydahl Andersen added a comment - you do keep these named queries in separate files from the entities mappings correct ? Because if you don't i'm quite sure it is the amount of mapping entities that "hurts" you. in any respect you should look at addCacheableFile which will remove the xml parsing overhead
        Hide
        Regis Pires Magalhaes added a comment -

        Where can we find documentation about addCachableFile?
        We´ve found something about Configuration.addLazyFile() in the wiki page "Performance: Hibernate startup time" but nothing about Configuration.addCachableFile(). We´ve also didn´t find it in Hibernate 3.0 final source code.

        Show
        Regis Pires Magalhaes added a comment - Where can we find documentation about addCachableFile? We´ve found something about Configuration.addLazyFile() in the wiki page "Performance: Hibernate startup time" but nothing about Configuration.addCachableFile(). We´ve also didn´t find it in Hibernate 3.0 final source code.
        Hide
        Max Rydahl Andersen added a comment -

        addCacheableFile is for sure in H3.

        addLazyFile was its first name during development - it does the same thing.

        Show
        Max Rydahl Andersen added a comment - addCacheableFile is for sure in H3. addLazyFile was its first name during development - it does the same thing.

          People

          • Votes:
            5 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development