I have designed an application with RestEasy.
I have used PreProcessInterceptor basically to intercept all the requests and validate the user from databse.
Once the validation is successfull, the requests go to the corresponding service api’s.
So my question is it right approach having an PreProcessInterceptor interceptor in which it interacts with database to validate user in one transaction and again calls the service api’s which in turn there will be one or more different database transaction for the business purpose.
So ideally there will be atleast 2 database hits for every request with 2 different transaction.
I have designed an application with RestEasy. I have used PreProcessInterceptor basically to intercept
Share
If your application has few users, sure go ahead. But since you’re asking I guess that’s not the case.
I wouldn’t recommend you to design the application the way you propose. I would advise you to use a proper security framework such as apache shiro. Shiro comes with good caching features right out of the box.