SAP Knowledge Base Article - Preview

2034156 - Singleton scoped beans dependent on tenant scoped beans - SAP Commerce

Symptom

Declare singleton scoped beans that have dependencies on tenant scoped beans.

The downside of this is that Spring doesn't handle such situations and no warnings and no error will be shown. For example, a singleton bean which has a injection of TenantScope-based model service.

So when the system is started, first the global ApplicationContext is loaded and then in that context, the singleton bean references only TenantScope model service. So in a multi-tenant system, this scenario will not work because it is not possible to use the singleton bean anymore from another TenantScope, because ModelService doesn't belong to this other tenant and will not be set properly.


Read more...

Environment

SAP Commerce

Keywords

bean, scope, tenetscope, proxy, dependency, commerce , KBA , CEC-SCC-PLA-PL , Platform , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.