*
*/
public PropertySet getPropertySet(long entryId) {
String key = "psCache_" + entryId;
PropertySet ps = (PropertySet)CacheController.getCachedObject("propertySetCache", key);
if(ps == null)
{
try
{
HashMap args = new HashMap();
args.put("entityName", "OSWorkflowEntry");
args.put("entityId", new Long(entryId));
InfoglueDefaultHibernateConfigurationProvider configurationProvider = new InfoglueDefaultHibernateConfigurationProvider();
configurationProvider.setSessionFactory(sessionFactory);
args.put("configurationProvider", configurationProvider);
ps = new CachingPropertySet();
Map args2 = new HashMap();
args2.put("PropertySet", PropertySetManager.getInstance("hibernate", args));
args2.put("bulkload", new Boolean(true));
ps.init(new HashMap(), args2);
CacheController.cacheObject("propertySetCache", key, ps);
//logger.info("Caching propertySet for entry: " + entryId + ":" + ps);
ps = PropertySetManager.getInstance("hibernate", args);
}
catch(Exception e)
{
e.printStackTrace();
try
{
logger.error("\n\nRestoring the session factory....");
//sessionFactory.close();
sessionFactory = new Configuration().configure().buildSessionFactory();
InfoglueDefaultHibernateConfigurationProvider configurationProvider = new InfoglueDefaultHibernateConfigurationProvider();
configurationProvider.setSessionFactory(sessionFactory);
Map args = new HashMap();
args.put("configurationProvider", configurationProvider);
ps = new CachingPropertySet();
Map args2 = new HashMap();
args2.put("PropertySet", PropertySetManager.getInstance("hibernate", args));
args2.put("bulkload", new Boolean(true));
ps.init(new HashMap(), args2);
}
catch (HibernateException he)
{
he.printStackTrace();
}