Schema-based Multi-Tenancy Async error

I created a vaadin project with Schema-based Multi-Tenancy, but when I run a process in background (async) using CompletableFuture and try to access the database he always got the public schema (my default) and not the schema from logged user, If I run the same process withtout async works fine

There is an way to when I call the CompletableFuture, pass the schema?


I can’t answer to mutli-tenancy async error, but that looks like the point 11 and 12 of the webinar: Securing Vaadin apps with Spring Security: Best Practices | Vaadin
12. Missing the Security Context Another common problem is that asynchronous code triggered by the backend does not have an active HTTP session that contains the Spring Security Context. You will most often run into this when you are using UI.access() and notice that you don't have access to a service. In this case, you can create a custom strategy for storing the Security Context in the Vaadin session instead.

So you might have some answers here

Tks… I will watch.