Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is tenant scope in Hybris?

I am very new to hybris e-commerce software and trying to learn with the help of wiki documents provided with it. I see use of 'tenant' scope quite frequently. I know about other scopes like 'singleton', 'prototype' etc. But I am not very clear with the tenant scope. appreciate if someone have a good understanding about this scope, and explain in simple terms. Thanks.

like image 659
Nirmal Mangal Avatar asked Nov 21 '13 17:11

Nirmal Mangal


People also ask

What is the scope of hybris?

Hybris adds a special scope named 'yrequest' to the core ApplicationContext. The yrequest scope may be used for binding beans to the application context for a single request. Upon session deactivation, the beans are no longer referenced from the application context, allowing them to be garbage collected.

What is multi-tenant in hybris?

Multi-tenancy means an individual set of data across one database. The Hybris e-commerce suite provides one single codebase that can be run over multiple set of data. A multi-tenant system: Provides isolation between a set of data (tenant). Provides the option of using separate databases.

Can a tenant provide option to use different timezone and locale than other?

As a tenant can optionally have locale settings different from the locale settings of the Virtual Machine, using the Java.

Is SAP Commerce Cloud multi-tenant?

SAP Commerce can be run in a multi-tenant mode. In this mode several distinct sets of data are maintained on one single SAP Commerce installation.


2 Answers

The core-spring.xml file of the core extension adds a special scope named tenant to the global ApplicationContext. The tenant scope makes sure that the bean is instantiated individually for each individual tenant of the hybris, whereas singleton would create only one instance for all tenants to use.

If you reference tenant-specific classes like services or DAOs inside your implementation, you have to use the tenant scope instead of the default Spring singleton scope. In case of doubt, use tenant instead of singleton.

<bean id="myExtension.myBean" class="de.hybris.platform.myExtension.myClass" scope="tenant" />

Since version 5.0 of hybris Commerce Suite, tenant scope is no longer in use.

Check this for more details...

like image 150
Free-Minded Avatar answered Dec 02 '22 01:12

Free-Minded


Hybris has 2 tenants by default- master tenant and junit tenant. You can create more tenants as required. Each tenant has its own set of data...say item types.

When a bean is defined in a tenant scope, it means that, that bean would be instantiated once for each tenant. And the same bean object would be used throughout the tenant.

like image 41
shravs Avatar answered Dec 01 '22 23:12

shravs