Skip to content

Doc: aop proxy interceptor doesn't wrap bean's init-method [SPR-2740] #7428

@spring-projects-issues

Description

@spring-projects-issues

Dmitry V. Zemnitskiy opened SPR-2740 and commented

In our application we use well adopted architecture with business manager implementing business interface.
Transaction proxy interceptor is wrapped around manager implementation to add declarative support of
hibernate transactions.

In the same business manager which is application level singleton we wished to use init-method to check
database and populate it with default bootstrap data (default system account, lookup data, etc).

What we noticed, is the transacton interceptor didn't wrap init-method even if it is included in proxy interface.

We solved this problem by creating another application level bean with init method which calls manager's method
when initialized.

I think it is relatively common usecase and spring aop should either intercept init-methods as well, or if it's impossible
for some architectural reason, just state this explicitly in spring documentation (lifecycle section or aop section).

Thanks, Dima


Affects: 2.0 RC4

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions