Must I assume it's evident bug if nobody answered me? Or it's apparently rare used feature which exists only for huge feature list?
There is just a lack of mindreaders on these forums.
Please try to explain what you are trying to do, then explain how you are trying to achive that. Then you might get some help.
Ok, if it needs explanations...
I try to achieve situation when each connect to database is personalized. So, no single user for all connection but each connection has own credentials.
How I tried to do that:
From -ds.xml file I removed user/password and added security-domain.
In documentation and Google I haven't found what's else there should be for personalized connections.
So, from this changes I assume when I login through LoginContext the same credentials will be used for creating connection.
What's followed I've already described. Maybe I'm wrong somewhere but where?
Wrong. Correct answer is CallerIdentityLoginModule.
But... Sorry, additional comments: we also needs method permissions. If I use these then I've got just exception. It seems like my credentials for connection are eaten by j2ee security.
NB: I have the same exception in either cases: either when I copy code of CallerIdentityLoginModule to "my" module or when I just modify CallerIdentityLoginModule and add here implementation of getRoleSets.
12:30:24,459 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Null user or password not supported in THIN
This time all seems obvious, doesn't? I just use JBoss LoginModule and because of that I've got exceptions. Ok, but can at least someone says how to correct that (possibly by writing own LoginModule)? Or, at least, at what stage credentials are lost?
(I repeat again but that is just if something is unclear from my previous post and mindreading is necessary again:
1. All is ok when I just use credentials for connection.
2. When I use method permissions they are consumed by j2ee security for them but totally lost for connection creating.)