Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invocation of @Async service fails [SPR-10636] #15264

Closed
spring-projects-issues opened this issue Jun 7, 2013 · 1 comment
Closed

Invocation of @Async service fails [SPR-10636] #15264

spring-projects-issues opened this issue Jun 7, 2013 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: regression A bug that is also a regression
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jun 7, 2013

Dimitar Makariev opened SPR-10636 and commented

The described feature works on 3.2.1.RELEASE, fails on 3.2.2.RELEASE and 3.2.3.RELEASE.

Trying to change object instance passed to service defined as @Async :

@Service
public class PopulateService {

    private final List<Person> persons;
    private final AsyncService asyncService;

    @Autowired
    public PopulateService(AsyncService asyncService) {
        persons = new ArrayList<Person>();
        this.asyncService = asyncService;
    }

    public void populatePersons(int numberOfPersons) {
        asyncService.populatePersons(persons, numberOfPersons);
    }

    public List<Person> getPersons() {
        return persons;
    }
}

@Service
public class AsyncService {

    @Async
    public void populatePersons(List<Person> persons, int numberOfPersons) {
        for (int i = 0; i < numberOfPersons; i++) {
            persons.add(new Person("first " + i, "last " + i));
        }
    }
} 

Affects: 3.2.2, 3.2.3

Attachments:

Issue Links:

Referenced from: commits 3562cd7, b6c54c3

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I've moved that executor null check to our proxy-based AsyncExecutionInterceptor now where we do want a strict check, allowing the AspectJ AbstractAsyncExecutionAspect to fall back to sync execution (as in 3.2.1).

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

2 participants