-
1. Re: User-specific connections
wdfink Sep 28, 2010 11:39 AM (in response to nickarls)AFAIK not.
The user is specific to the *-ds.xml.
Only way is to use multiple *-ds.xml configuration, but indeed it is not dynamic and might a connection overload of the database.
-
2. Re: User-specific connections
nickarls Sep 29, 2010 7:38 AM (in response to wdfink)I have a theory that it could be done with a custom JCA LoginModule but I haven't looked into it more closely (and it's for the JCA forum)
-
3. Re: User-specific connections
northgorky Sep 29, 2010 3:14 PM (in response to nickarls)I did this a while back with JBoss 4.2.2. I would dynamically create a DS, then load it in the jNDI tree, with part of the path based on the company name of the user. Code would then retrieve connection from JNDI based on the user's company name. Neat thing was, I set the min connection value in the connection pool to 0, so if nobody was actually using that connection, the connections would close. The specifics won't work for JBoss 5, but you might be able to adapt them. I posted this on the mailing list ages ago, and the forum some time ago. If you need and can't find, let me know. If you wind up using this solution and patching for JBoss 5., I would appreciate an email to where you posted the upgrade.
Regards,
Steve
-
4. Re: User-specific connections
wdfink Oct 6, 2010 4:18 AM (in response to nickarls)I found something in the configuration.
You can use <application-mananged-security/> within the *-ds.xml (see generic-ds.xml) docs/examples/jca.
You are able to use getConnectio(use,psw) within the application. I'm not sure whether this is practicable with JPA ;-)
Also I'm not sure what the behaviour of pool is.