Hello, I'm developing a tool using Hibernate and postgresql DBMS which will allow users to create project (very large set of information). To optimize performance, we opted to build a single database per user connection to back up only the data are proposed. Summarizing, One USER = One Database. However, the services layer for data accessing remains the same. It is therefore, when a User login that, (1) i create a database for its data (its workspace), and (2) i redirect Hibernate to the correct user database. An unlikely solution would be to modify hibernate.cfg.xml at application's startup and update classpath. But that does not interest me. Someone told me that I could use the hibernate datasources component to claim my problem. would Someone give me a piece of sample code using hibernate datasources component?
Any other solution approach to solve this problem interesst me.
Regards.
|