dennisbyrne wrote:
Our shop has two Hibernate utilities. Each one has a static initialization block that loads all the mapping data and creates a session factory. I am using both of the utilities, and want to avoid loading the config intormation twice. How to I check for this programmatically?
I can think of moving the static sessionfactory and its initialization into a singleton class. And in the two utility classes, just get the instance of singleton, get the sessionfactory and call the methods on it.
But i'm inquisitive as to why two Hibernate Utility classes are required in the first place. Can you tell this specific scenario where you are using two Hibernate Utility classes ? I couldn't think of any.