Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-1636

@Configurable might have impacts on performance. Provide means for alterantive style for injecting EntityManager into domain objects

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Invalid
    • Affects Version/s: 1.1.0.RELEASE
    • Fix Version/s: None
    • Component/s: PERSISTENCE
    • Labels:
      None

      Description

      When having queries with big result sets, @Configurable might have serious impact on performance.

      For example, let's say we have an Entity FooBar, of which we retrieve 80000 instances from DB.

      On my machine the creation of those 80000 instances takes about 7 seconds. Without @Configurable, it takes only some milliseconds. Pefromance monitoring shows, that most time is spent in BreanConfigurerSupport in first case.

      Thus, Roo should allow for some (optional) alternative approach to @Configurable.

      There have been other issues with proposals around here. For instance, there might be a singleton object, where EntityManager is injected and that provides it by some static method to the domain objects.

      Something like this:

      @Configurable
      class DomainObjectConfig{
        @PersistenceContext EntityManager em;
      
        
        public static DomainObjectConfig getSingletonInstance(){ ... }
        public EntityManager getEntityManager(){ return em;}
      }
      

        Attachments

          Activity

            People

            • Assignee:
              stewarta Alan Stewart
              Reporter:
              stefanoc Stefan Ocke
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: