ok ,
i have application which is trying to get session upon (lets say )5 different DB. (let's say you want to log to DB- Paris, DB-London, DB-Prague, DB-Berlin, DB-Zurich, but the DB structure is same)
Some users have only acces to some of them.
thats why I use
List allDatabases (it has objects of HibernateDatabase for all databases which are in configuration file)
and
List databaseForUser(which has object HibernateDatabase only for that database user provide sufficient username/password)
public HibernateDatabase() {
private String databaseName;
private String dialect;
private String conectionURL;
private String conectionDriver;
private String cacheProvider;
.....
}
When user will try to log he will iterate over the collection with all databases and try to log there with provided user's username/password.
If he gets SessionFactory(if it buildSettings) it means that he has rights to access database (and that DB will be added to users List) and if he gets Exception or null it would mean that user has no rights to that database (and that DB will NOT be added to the User's list).
AnyWay when I look at the hibernate SettingsFactory it has change. Why it doesn't throw HibernateException? There is only try/catch with warning but id doesn't throw exception.
version 2.1
Code:
public final class SettingsFactory {
private static final Log log = LogFactory.getLog(SettingsFactory.class);
public static Settings buildSettings(Properties properties) throws HibernateException {
version 3.0.5
Code:
public class SettingsFactory implements Serializable {
private static final Log log = LogFactory.getLog(SettingsFactory.class);
protected SettingsFactory() throws HibernateException {}
public Settings buildSettings(Properties props) {