try
{
List groupPropertiesVOList = this.getGroupPropertiesVOList(groupName, languageId, db);
Iterator iterator = groupPropertiesVOList.iterator();
GroupPropertiesVO groupPropertyVO = null;
while(iterator.hasNext())
{
groupPropertyVO = (GroupPropertiesVO)iterator.next();
break;
}
if(groupPropertyVO != null && groupPropertyVO.getId() != null)
{
if(CacheController.getCacheSize("propertiesCategoryCache") == 0 && preCacheInProgress.compareAndSet(false, true))
{
try
{
PropertiesCategoryController.getController().preCacheAllPropertiesCategoryVOList();
}
finally
{
preCacheInProgress.set(false);
}
logger.warn("preCacheAllPropertiesCategoryVOList took: " + t.getElapsedTime());
}
String key = "categoryVOList_" + attribute + "_" + GroupProperties.class.getName() + "_" + groupPropertyVO.getId();
List<CategoryVO> categoryVOList = (List<CategoryVO>)CacheController.getCachedObject("propertiesCategoryCache", key);
if(categoryVOList != null)
{
//System.out.println("Returning cached result:" + categoryVOList.size());
relatedCategories = categoryVOList;
}
else
{
if(CacheController.getCachedObject("propertiesCategoryCache", "allValuesCached") != null)
{
//System.out.println("Skipping as there is no such property in the full precache..");
}
else
{
logger.warn("Reading the hard way for:" + key);
List propertiesCategoryList = PropertiesCategoryController.getController().findByPropertiesAttributeReadOnly(attribute, GroupProperties.class.getName(), groupPropertyVO.getId(), db);
Iterator propertiesCategoryListIterator = propertiesCategoryList.iterator();
while(propertiesCategoryListIterator.hasNext())
{
PropertiesCategory propertiesCategory = (PropertiesCategory)propertiesCategoryListIterator.next();