cancel
Showing results for 
Search instead for 
Did you mean: 

Destination in tenant space not found

Former Member
0 Kudos

HI,

When i spawn a new Thread in my application  and try to find the destination in that new  thread,  the destination in tenant space is not being picked up.

But, if i configure a destination with same name in provider space, that gets picked up by destinationfactory.getDestination()

​so,I think the tenantcontext is lost in the new thread. Please find the sample code attached.

Is there any way to get around this problem?

Accepted Solutions (1)

Accepted Solutions (1)

nikolai_tankov
Explorer
0 Kudos

Hi,

Tenant context is not propagated from parent -> child threads. New (background) threads are executed on behalf of the provider account. You can change tenant context in background threads using com.sap.cloud.account.TenantContext#execute() method.  More details are available here : https://help.hana.ondemand.com/javadoc/com/sap/cloud/account/TenantContext.html.

Best regards,

  Nikolai.

Answers (0)