[jboss-user] [JBoss Seam] - Re: Change Database Connection at Runtime

stephen.friedrich do-not-reply at jboss.com
Fri Sep 28 05:10:54 EDT 2007


We had the same problem and never really found a solution for it.
The (business/legal) requirement was to store each clients financial data in a separate DB, but have a single web application where a use can switch between different clients (depending on authorizations).

We never really found a way to solve the problem. As a workaround we
did what Ralph proposed and individually configured lots of datasources (one for each client, plus a couple spare ones) with generic names and access the entity manager programmatically.
Besides being an ugly hack and wasting resources it does not really solve the problem the original poster is having:

What do you do if the database connection details are only delivered dynamically after login?

This would be dead-easy to do with JDBC, but Hibernate/JPA/Seam makes this hard to do.

@bravefencer (?): Put code into code tags!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089606#4089606

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089606



More information about the jboss-user mailing list