Is there a way to use caller identity to connect database and fallback to default username/password if no caller?
When I user old JBoss AS, I was able to configure datasource to use security-domain backed with CallerIdentityLoginModule so remote user can connect to database with his username and password. Also, CallerIdentityLoginModule defines username and password which used if there no real user, for example when running EJB scheduled methods.