0 Replies Latest reply on Jan 25, 2008 5:27 AM by sveerpal

    JBoss LRUCache failure

    sveerpal

      Application is hosted on JBoss server and uses Hibernate caching.

      i got very strange error and could not launch the application after that, I had to restart the server finally. It was related to prepared statement cache. The error log was

      [22-01-2008 13:08:04.150] [67934313] [STDOUT] [INFO ] [TP-Processor9] 22-Jan-2008 13:08.04 ERROR {NDC=} java.lang.IllegalStateException: Attempt to put a new cache entry on a full cache
      java.lang.IllegalStateException: Attempt to put a new cache entry on a full cache
      at org.jboss.util.LRUCachePolicy$LRUList.promote(LRUCachePolicy.java:304)
      at org.jboss.util.LRUCachePolicy.get(LRUCachePolicy.java:128)
      at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:295)
      at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:172)
      at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:442)
      at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:368)
      at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:105)
      at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
      at org.hibernate.loader.Loader.doQuery(Loader.java:661)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
      at org.hibernate.loader.Loader.doList(Loader.java:2145)
      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
      at org.hibernate.loader.Loader.list(Loader.java:2024)
      at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
      at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1533)
      at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
      at org.springframework.orm.hibernate3.HibernateTemplate$35.doInHibernate(HibernateTemplate.java:979)
      at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367)
      at org.springframework.orm.hibernate3.HibernateTemplate.findByCriteria(HibernateTemplate.java:969)
      at org.springframework.orm.hibernate3.HibernateTemplate.findByCriteria(HibernateTemplate.java:962)

      prepared statement cahce size is configured to be 25 in datasource configurations, is increasing the size solution of this, but as per LRU even if the cache is full new entry should replace the least recently used entry of the cache. Please suggest....