Entity cache problem

Hi!
I’m trying to turn entity cache on. I tried following this manual Entity and Query Cache - CUBA Platform. Developer’s Manual. But when using datasource with cacheable=true i get this warning “Using cacheable query without entity cache for …”, and load time strongly increase(from 8s to 200s).
I tried to add @Cache and @Cacheable annotation to entity, but got same result.

<properties>
          <property name="eclipselink.cache.shared.default" value="false"/>
          <property name="eclipselink.cache.shared.SomeEntity" value="true"/>
          <property name="eclipselink.cache.type.SomeEntity" value="SOFT"/>
          <property name="eclipselink.cache.size.SomeEntity" value="64000"/>
 </properties>

After i added this to persistence.xml warn disappered, but load time is still 200s.

Hi,

First of all, make sure you specify entity name and not simple class name in app properties (notice $ in the last part):
eclipselink.cache.shared.sales$Customer = true

After setting up cache, set the eclipselink.sql logger to DEBUG and restart the server, then you can see in the log whether the number of SQL requests decreases.

Hi @knstvk,

I’ve been experiencing the same issue. (CUBA 7.0)

I have set the
eclipselink.cache.shared.gantttest$Employee= true
eclipselink.cache.size.gantttest$Employee = 500
in my core - app.properties.

In my dataloader I set the attribute of EmployeeDl:
<loader id="employeesDl" cacheable="true">

but It is till giving me the following error:
10:22:25.537 WARN c.h.c.c.s.e.QueryCacheManager - Using cacheable query without entity cache for gantttest_Employee

I have also tried using:
eclipselink.cache.shared.gantttest_Employee= true
eclipselink.cache.shared.GANTTTEST$Employee= true
eclipselink.cache.shared.GANTTTEST_Employee= true

but I keep getting the same error.

Is there anything I’m forgetting or doing wrong?

Hello.

I could not repeat your scenario to receive the same error.
My case:

Entity:

@Table(name = "ST_TEST_ENTITY")
@Entity(name = "st$TestEntity")
public class TestEntity extends StandardEntity { ... }

Dataloader:

<loader id="testEntitiesDl" cacheable="true">
     <query>
          <![CDATA[select e from st$TestEntity e]]>
     </query>
</loader>

App properties:

eclipselink.cache.shared.st$TestEntity = true
eclipselink.cache.size.st$TestEntity = 500

@Timmothyquist could you please provide a test project that produces an error that you described?

@shipilov
I created a testproject but was not able to reproduce the error as well (with a single entity).

So I went to look deeper into the project with the issue. My Employee entity had a one-to-many composition with the Task entity. The employee entity was set cachable but the Task entity was not. In my screen dataloader I am getting the Employee with the Task entity as an attribute. But the Task entity is not cached. That’s why I was getting the warning:
Using cacheable query without entity cache for gantttest_Employee
Because the uncached Task entity was obtained trough the Employee entity. (I think).

Thank you for confirming there was nothing wrong with the syntax I used for the entity caching, I thought I made a mistake here somewhere.