This discussion is archived
3 Replies Latest reply: Nov 20, 2012 11:36 PM by r035198x RSS

CacheFullException: cache size after cleaning

975010 Newbie
Currently Being Moderated
Hello, all.
I need you help. Unfortunately, because of i am a new in Java, my question may be a bit stupid and incorrectly formulated—é
I have an exception:
2012-10-15 11:09:01,293 ERROR [[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'] (DispatcherServlet.java:154) /se.netwise.mcx.web.DispatcherServlet/ - An error occurred when trying to dispatch GET action: /McxOwu/listCompanies.action
java.rmi.RemoteException: EJB Exception: ; nested exception is: 
     javax.ejb.EJBException: Exception in ejbLoad:: weblogic.ejb20.cache.CacheFullException: cache size after cleaning=4001, max allowable cache size=4000, extra free space required but not obtainable = 1
     at weblogic.ejb.container.cache.EntityCache$SizeTracker.acquireSpace(EntityCache.java:765)
     at weblogic.ejb.container.cache.EntityCache.put(EntityCache.java:219)
     at weblogic.ejb.container.manager.DBManager.getReadyBean(DBManager.java:418)
     at weblogic.ejb.container.manager.DBManager.preInvoke(DBManager.java:310)
     at weblogic.ejb.container.internal.BaseLocalObject.preInvoke(BaseLocalObject.java:239)
     at weblogic.ejb.container.internal.BaseLocalObject.preInvokeLite(BaseLocalObject.java:179)
     at weblogic.ejb.container.internal.EntityEJBLocalObject.preInvokeLite(EntityEJBLocalObject.java:91)
     at se.netwise.mcx.domainservice.entity.ejb.CompanyBean_3rx9vq_ELOImpl.getCompanyId(CompanyBean_3rx9vq_ELOImpl.java:1944)
     at se.netwise.mcx.domainservice.dao.CompanyDAO.getCompaniesForServiceProviderWithFilters(CompanyDAO.java:558)
...
when i trying to upload info from DB to Entity Cache. I know that it's not a good way for this issue, but it was not me who developed this product. I should solve it.
An exception happens in this code
public CompanyTO[] getCompaniesForServiceProvider(String serviceProviderId)
          throws DomainFinderException {
     Collection companies;
     try {
          companies = CompanyBeanUtil.getLocalHome()
                    .findByServiceProviderId(serviceProviderId);
          } catch (FinderException e) {
          LOG.error(e);
          if (e instanceof ObjectNotFoundException) {
               throw new DomainFinderException();
          }
          throw new DomainSysException();
     } catch (NamingException e) {
          LOG.error(e);
          throw new DomainSysException(e.getMessage());
     }
     ArrayList<CompanyTO> companyTOList = new ArrayList(companies.size());
     CompanyBeanLocal local;
     for (Iterator iter = companies.iterator(); iter.hasNext();) {
          local = (CompanyBeanLocal) iter.next();
          companyTOList.add(new CompanyTO(local.getCompanyId(), local.getCompanyName(), local.getCompanyBillingNumber()));
     }
     sortCompanyTOByCompanyName(companyTOList);
     return (CompanyTO[]) companyTOList.toArray(new CompanyTO[0]);
}
in this line:
companyTOList.add(new CompanyTO(local.getCompanyId(), local.getCompanyName(), local.getCompanyBillingNumber()));

So i want to delete local object from Entity cache after adding it to my Array. But i don't how to do it.
I found method EntityCache.remove:

public void remove(java.lang.Object arg0, weblogic.ejb.container.cache.CacheKey arg1);

but what is arg0 and arg1, how to obtain it?

Thanks

Edited by: 972007 on Nov 19, 2012 7:30 AM

Edited by: 972007 on Nov 19, 2012 7:30 AM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points