Man*_*wal 2 persistence ignite
my cache is empty so sql queries return null. The read-through means that if the cache is missed, then Ignite will automatically get down to the underlying db(or persistent store) to load the corresponding data.
If there are new data inserted into the underlying db table ,i have to down cache server to load the newly inserted data from the db table automatically or it will sync automatically ?
Is work same as Spring's @Cacheable or work differently.
It looks to me that the answer is no. Cache SQL query don't work as no data in cache but when i tried cache.get in i got following results :
case 1:
System.out.println("data == " + cache.get(new PersonKey("Manish", "Singh")).getPhones());
Run Code Online (Sandbox Code Playgroud)
result ==> data == 1235
case 2 :
PersonKey per = new PersonKey();
per.setFirstname("Manish");
System.out.println("data == " + cache.get(per).getPhones());
Run Code Online (Sandbox Code Playgroud)
throws error:- as following error image, image2
当有一组已知的要读取的键时,可以应用通读语义。这不是 SQL 的情况,因此如果您的数据位于任意 3rd 方存储(RDBMS、Cassandra、HBase 等)中,您必须在运行查询之前将数据预加载到内存中。
但是,Ignite 提供了原生持久性存储 [1],可以消除这种限制。它允许在没有任何内存的情况下使用任何 Ignite API,这也包括 SQL 查询。数据将在您使用时按需提取到内存中。
[1] https://apacheignite.readme.io/docs/distributed-persistent-store
| 归档时间: |
|
| 查看次数: |
1395 次 |
| 最近记录: |