Topic
  • No replies
MandarChatufale
MandarChatufale
18 Posts

Pinned topic Enabling Query Cache

‏2013-08-20T13:44:54Z |

Hi,

I am using wxs as L2 cache for Hibernate and JPA. I am using stand alone version of wxs server(8.6) . 

I have put all the required jars in Shared Library. I am using websphere 7.0

I have made required configuration in objectgrid.xml and jpa properties.

Do i need to set query region value in my code ? I am doind a find by name operation.

TypedQuery<Customer> query =  entityManager.createQuery("from Customer c where c.name like :name", Customer.class);

        query.setHint("org.hibernate.cacheable",true);
        query.setHint("org.hibernate.cacheRegion","com.deere.dsfjwxs.domain.Customer");
 

After setting above values in my code i get below exception

org.springframework.orm.hibernate3.HibernateSystemException: Can't get sql: select customer0_.CUSTOMER_NUMBER as CUSTOMER1_4_, customer0_.CUSTOMER_ADDRESS as CUSTOMER2_4_, customer0_.CUSTOMER_CITY as CUSTOMER3_4_, customer0_.CUSTOMER_NAME as CUSTOMER4_4_, customer0_.CUSTOMER_STATE as CUSTOMER5_4_, customer0_.CUSTOMER_ZIP as CUSTOMER6_4_ from ADVJPMT.CUSTOMERS customer0_ where customer0_.CUSTOMER_NAME like ?; parameters: ; named parameters: {name=Mandar%}; nested exception is org.hibernate.cache.CacheException: Can't get sql: select customer0_.CUSTOMER_NUMBER as CUSTOMER1_4_, customer0_.CUSTOMER_ADDRESS as CUSTOMER2_4_, customer0_.CUSTOMER_CITY as CUSTOMER3_4_, customer0_.CUSTOMER_NAME as CUSTOMER4_4_, customer0_.CUSTOMER_STATE as CUSTOMER5_4_, customer0_.CUSTOMER_ZIP as CUSTOMER6_4_ from ADVJPMT.CUSTOMERS customer0_ where customer0_.CUSTOMER_NAME like ?; parameters: ; named parameters: {name=Mandar%}
 

Kindly guide.

Thanks