JPAApi - how to execute a "SET" statement at the beginning of every database session?

(koz) #1

Well, this is probably more of a JPA question, but anyway…

In order to implement multitenancy, I have to do something like this at the beginning of every database session

SET SESSION "myapp.tenant" = 123

I tried to use an EmptyInterceptor, but I can’t figure out how to access the current JPAApi from there. Any ideas?

By the way I’m using Play Java 2.6.21