Hi Alexey Kuznetsov, Please see attachment for demo. In the attachment, I defined two classes , one for key and one for value. And the jdbctype mapping is described in CacheConfig.java
I am using the following commands to create table and generate two records:
create table test_table (column1 varchar2(20), column2 varchar2(20));
insert into test_table (column1, column2) values('def','789012' );
insert into test_table (column1, column2) values('abc','123456' );
my class load function is defined as:
Ignite ignite = Ignition.start(igniteCCF);
IgniteCache<TestTableKey, TestTable> cache= ignite.getOrCreateCache(ccf);
cache.loadCache(null, TestTableKey.class, "select * from
dequations.test_table");
cache.close();
ignite.close();
and the error messages that displayed on client side as follows:
Exception in thread "main" javax.cache.integration.CacheLoaderException:
javax.cache.CacheException: Failed to find mapping description
[cache=TestTableCache, typeId=1153306422]. Please configure JdbcType to
associate cache 'TestTableCache' with JdbcPojoStore.
at
org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadCache(GridCacheStoreManagerAdapter.java:538)
at
org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheAdapter.localLoadCache(GridDhtCacheAdapter.java:497)
at
org.apache.ignite.internal.processors.cache.GridCacheProxyImpl.localLoadCache(GridCacheProxyImpl.java:228)
at
org.apache.ignite.internal.processors.cache.GridCacheAdapter$LoadCacheJob.localExecute(GridCacheAdapter.java:5753)
at
org.apache.ignite.internal.processors.cache.GridCacheAdapter$LoadCacheJobV2.localExecute(GridCacheAdapter.java:5802)
at
org.apache.ignite.internal.processors.cache.GridCacheAdapter$TopologyVersionAwareJob.execute(GridCacheAdapter.java:6473)
at
org.apache.ignite.compute.ComputeJobAdapter.call(ComputeJobAdapter.java:132)
at
org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2V2.execute(GridClosureProcessor.java:2006)
at
org.apache.ignite.internal.processors.job.GridJobWorker$2.call(GridJobWorker.java:509)
at
org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6521)
at
org.apache.ignite.internal.processors.job.GridJobWorker.execute0(GridJobWorker.java:503)
at
org.apache.ignite.internal.processors.job.GridJobWorker.body(GridJobWorker.java:456)
at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
at
org.apache.ignite.internal.processors.job.GridJobProcessor.processJobExecuteRequest(GridJobProcessor.java:1095)
at
org.apache.ignite.internal.processors.job.GridJobProcessor$JobExecutionListener.onMessage(GridJobProcessor.java:1766)
at
org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1238)
at
org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:866)
at
org.apache.ignite.internal.managers.communication.GridIoManager.access$1700(GridIoManager.java:106)
at
org.apache.ignite.internal.managers.communication.GridIoManager$5.run(GridIoManager.java:829)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.cache.CacheException: Failed to find mapping description
[cache=TestTableCache, typeId=1153306422]. Please configure JdbcType to
associate cache 'TestTableCache' with JdbcPojoStore.
at
org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore.entryMapping(CacheAbstractJdbcStore.java:693)
at
org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore.loadCache(CacheAbstractJdbcStore.java:727)
at
org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadCache(GridCacheStoreManagerAdapter.java:512)
... 21 more
Best Regards,
Kevin
发件人: Alexey Kuznetsov [mailto:[email protected]]
发送时间: 2016年8月10日 16:28
收件人: [email protected]
主题: Re: ignite 1.7 cache load problem
Hi, Kevin
It is possible to provide minimal reproducible example?
config + type + db ddl script (also specify what DB you are using).
Thanks.
On Wed, Aug 10, 2016 at 3:24 PM, Zhengqingzheng
<[email protected]<mailto:[email protected]>> wrote:
Hi there,
When using the new ignite (1.7.0) to load data from database into cache, I get
the following error
Caused by: javax.cache.CacheException: Failed to find mapping description
[cache=EntityReleaseTargetCache, typeId=-163799280]. Please configure JdbcType
to associate cache 'EntityReleaseTargetCache' with JdbcPojoStore.
It was okay to perform cache load within 1.5.0.final version. But cannot load
data in the new version.
I have already set the jdbc mapping via the schema-import util generated class
file CacheConfig.java.
Any one facing the same problem as I did?
Best regards,
Kevin
--
Alexey Kuznetsov
GridGain Systems
www.gridgain.com<http://www.gridgain.com>
TestTable.java
Description: TestTable.java
TestTableKey.java
Description: TestTableKey.java
CacheConfig.java
Description: CacheConfig.java
