Issue Details (XML | Word | Printable)

Key: JERSEY-2060
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: dankirkd
Votes: 1
Watchers: 2

If you were logged in you would be able to see more operations.

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

Created: 21/Aug/13 08:59 PM   Updated: 04/Nov/13 06:00 PM
Component/s: None
Affects Version/s: 2.2
Fix Version/s: backlog

Time Tracking:
Not Specified

Tags: spring
Participants: dankirkd

 Description  « Hide

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.

dankirkd added a comment - 21/Aug/13 09:01 PM

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.