max wrote:
basically yes - just like if you used jdbc, where you need to use a different datasource per customer
Sweet! So I can do something like this in my BaseDAO:
protected void getSession(String clientIdentifier) {
try {
// call the corresponding session factory's getSession
// for this client
//
if (clientIdentifier.equalsIgnoreCase("Client A")) {
ClientA_HibernateSessionFactory.getSession();
} else if (clientIdentifier.equalsIgnoreCase("Client B")) {
ClientB_HibernateSessionFactory.getSession();
} else {
// throw some sort of an exception
}
} catch (Exception e) {
// there was a problem closing the DAO session.
//
logger.fatal(e.getMessage(), e);
}
}
I can write a similar method for closing the session as well... Then it will be a matter of modifying this BaseDAO and writing additional session facotries... right?
Thanks a bunch Max.
Arup