I have the same requirement/problem at the moment. I cannot specify the datasource in the deployment descriptor of the EJBs because it varies depending on the account being operated on. Accounts are added/removed occasionally and to redeploy the app every time is just crazy. A number of users have access to the each account (DB).
In my current experiment I have created a data source factory which creates custom datasources which maintain their own pool but this seems to be creating some strange problems of it own and seems to confuse jboss transaction manager. I am about to try another approach and will post here if any more successful..
Please if anyone else has already done this let me know.
I need to be able to create/destroy/access new datasources on the fly.