[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
CCEE-Persistence: Log-Warning-Message "Dummy tenant access is used."  XML
Forum Index -> Development
Author Message
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5520
Offline

(copied from mail - response through forum)

What does the log message mean?

Code:
 Dummy tenant access is used. Only should be used in test scenarios.
 

Björn Müller, CaptainCasa GmbH
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5520
Offline

CCEE persistence supports multi-tenant tables.

Code:
 Example:
 
 Table "Article"
 Fiels:
 TENANT (key)
 ARTICLEID (key)
 TEXT
 WEIGHT
 ...
 


So the system is used by several compaies/tenants - and the data of each company/tenant is separated from the other's by the TENANT field in each table.

In the corresponding entity object you define:
Code:
 @doentity(name="ARTICLE",tenantColumn="TENANT")
 public class DOAritcle
 {
      @doproperty(key=true,name="ARTICLEID")
     public String getArticleId() ...
     ...
 }
 


For the application the TENANT-columns is invisible. The application lives in a tenant context - and all SQL statements to the DB are automatically updated so taht the tenant column is filled correctly.

Now...: how to define the tenant context?

The central interface here is "ITenantAccess" which is used by the CCEE-functions (and in general by CC-functions).

When using "DefaultTenantAccess", then the tenant context is created in two ways:

Code:
 a. DefaultTenantAccess.associateTenantWithCurrentSession("TENANT4711");
 b. DefaultTenatnAccess.associateTenantWithCurrentThread("TENANT4711");
 


a. is used for threads that are processed within a http-request processing. Here the tenant is stored in the session context.
b. is used in threads that are independent from http-request processing. Here the tenant is stored in a Thread-Map.

If you do not explicitly create a tenant context (e.g. when testing), then tenant "undefined" is used. And then you get the message that you showed. - Working with tenant "undefined" should be an option that you really use for text purpose only...!

Regards, Björn

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team