jersey
  1. jersey
  2. JERSEY-2060

Spring Integration @Singleton and @Scope("singleton") behavior differs when it should be the same

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2
    • Fix Version/s: backlog
    • Component/s: None
    • Labels:
      None

      Description

      Expected: @Scope("singleton") and @Singleton do the same thing (and that using @Scope("singleton") is the same as not having the scope defined since "singleton" is the default).

      Actual: If I use @Scope("singleton") instead of @Singleton, then for @Service, @Controller, or @Repository my constructor and setters ARE called, and I DON'T get the same instance of my service back each call, I get a different one. With @Component, the setters are called and I DO get the same instance of my service back each time.

        Activity

        Hide
        dankirkd added a comment -

        Perhaps related to this is the fact that when I make my first web service call (annotated with @Service @Singleton), Jersey creates a new instance of my class, instead of using what Spring has already created at startup.

        Show
        dankirkd added a comment - Perhaps related to this is the fact that when I make my first web service call (annotated with @Service @Singleton), Jersey creates a new instance of my class, instead of using what Spring has already created at startup.

          People

          • Assignee:
            Unassigned
            Reporter:
            dankirkd
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: