Uploaded image for project: 'Spring Data Commons'
  1. Spring Data Commons
  2. DATACMNS-1368

Add support for deferred initialization of repositories


    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1 RC2 (Lovelace)
    • Component/s: None
    • Labels:


      The initialization of repositories usually triggers verifications of query methods, mappings etc. to make sure it is in correct state. Some of these verifications require the interaction with the underlying store infrastructure that needs to have been initialized completely at that point. As that in turn might be a rather expensive operation it can significantly slow down the startup of the application. While generally checking the correctness of a setup is a honorable intention, there might be contexts (e.g. local development) in which the bootstrap time becomes the primary concern.

      Assuming the store infrastructure can be lazified in the first place, the currently available mechanism is to mark the repository as lazy (e.g. by annotating the interface with @Lazy) but then also mark every injection point of that repository with @Lazy, too. The latter is pretty error-prone as a single missed injection point will spoil the entire effort as the initialization will be triggered.

      We should investigate options of automatically making all repository injection points lazy either by default or selectively if a repository is marked as lazy in the first place.


          Issue Links



              • Assignee:
                olivergierke Oliver Drotbohm
                olivergierke Oliver Drotbohm
                Last updater:
                Jens Schauder
              • Votes:
                0 Vote for this issue
                1 Start watching this issue


                • Created: