You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Andrey Mashenkov (Jira)" <ji...@apache.org> on 2019/10/02 14:11:00 UTC

[jira] [Resolved] (IGNITE-10690) Ignite throws exception when storing an object with an Instant field

     [ https://issues.apache.org/jira/browse/IGNITE-10690?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrey Mashenkov resolved IGNITE-10690.
---------------------------------------
    Release Note: 
Not a bug. Type mapping is correct.  

Firstly, we should review all date\time types convertion and theirs binary format.
Then create a proper tickets to fix.
      Resolution: Won't Fix

> Ignite throws exception when storing an object with an Instant field
> --------------------------------------------------------------------
>
>                 Key: IGNITE-10690
>                 URL: https://issues.apache.org/jira/browse/IGNITE-10690
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 2.7
>            Reporter: Benjamin Dunton
>            Priority: Blocker
>             Fix For: 2.8
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> This was working fine with Ignite 2.6.0 and H2 version 1.4.196. I upgraded to Ignite 2.7 and H2 version 1.4.197, and it is now broken.
> I am using spring-data with a repository defined like this:
> {{@RepositoryConfig(cacheName = "myObjectCache")}}
>  {{interface MyObjectRepository extends IgniteRepository<SomeObject, String> {}}
>  {{    ...}}
>  {{}}}
> If SomeObject has a field of type Instant, I get an IgniteCheckedException when inserting the object into the repository.
> This broke as a result of the recent H2 upgrade in IGNITE-4150. In H2 version 1.4.197, they changed the way Instant fields are mapped to the underlying data type. In 1.4.196 and earlier, Instants were mapped to Value.JAVA_OBJECT, but now are mapped to Value.TIMESTAMP_TZ (see org.h2.value.DataType.getTypeFromClass(Class<?> x)).
> When GridH2RowDescriptor tries to wrap the value, it doesn't recognize TIMESTAMP_TZ, and it throws IgniteCheckedException. See GridH2RowDescriptor.wrap(Object, int).
>  
> Here is the relevant part of the stack trace:
> {code}
> org.h2.message.DbException: General error: "class org.apache.ignite.IgniteCheckedException: Failed to wrap value[type=24, value=2018-12-14T13:07:30.982Z]" [50000-197]
> at org.h2.message.DbException.get(DbException.java:168)
> at org.h2.message.DbException.convert(DbException.java:307)
> at org.apache.ignite.internal.processors.query.h2.opt.GridH2KeyValueRowOnheap.getValue0(GridH2KeyValueRowOnheap.java:138)
> at org.apache.ignite.internal.processors.query.h2.opt.GridH2KeyValueRowOnheap.getValue(GridH2KeyValueRowOnheap.java:113)
> at org.apache.ignite.internal.processors.query.h2.opt.GridH2KeyValueRowOnheap.toString(GridH2KeyValueRowOnheap.java:201)
> at java.lang.String.valueOf(String.java:2994)
> at java.lang.StringBuilder.append(StringBuilder.java:131)
> at org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.doRemove(BPlusTree.java:1969)
> at org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.removex(BPlusTree.java:1764)
> at org.apache.ignite.internal.processors.query.h2.database.H2TreeIndex.removex(H2TreeIndex.java:345)
> at org.apache.ignite.internal.processors.query.h2.opt.GridH2Table.remove(GridH2Table.java:521)
> at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.remove(IgniteH2Indexing.java:797)
> at org.apache.ignite.internal.processors.query.GridQueryProcessor.remove(GridQueryProcessor.java:2596)
> at org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager.remove(GridCacheQueryManager.java:435)
> at org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.finishRemove(IgniteCacheOffheapManagerImpl.java:2709)
> at org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.remove(IgniteCacheOffheapManagerImpl.java:2686)
> at org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl.remove(IgniteCacheOffheapManagerImpl.java:651)
> at org.apache.ignite.internal.processors.cache.GridCacheMapEntry.removeValue(GridCacheMapEntry.java:4362)
> at org.apache.ignite.internal.processors.cache.GridCacheMapEntry.invalidate(GridCacheMapEntry.java:2914)
> at org.apache.ignite.internal.processors.cache.transactions.IgniteTxAdapter.uncommit(IgniteTxAdapter.java:486)
> at org.apache.ignite.internal.processors.cache.transactions.IgniteTxLocalAdapter.userCommit(IgniteTxLocalAdapter.java:966)
> at org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal.localFinish(GridNearTxLocal.java:3646)
> at org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxFinishFuture.doFinish(GridNearTxFinishFuture.java:475)
> at org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxFinishFuture.finish(GridNearTxFinishFuture.java:425)
> at org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal$25.apply(GridNearTxLocal.java:3788)
> at org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal$25.apply(GridNearTxLocal.java:3782)
> at org.apache.ignite.internal.util.future.GridFutureAdapter.notifyListener(GridFutureAdapter.java:385)
> at org.apache.ignite.internal.util.future.GridFutureAdapter.listen(GridFutureAdapter.java:355)
> at org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal.commitNearTxLocalAsync(GridNearTxLocal.java:3782)
> at org.apache.ignite.internal.processors.cache.GridCacheSharedContext.commitTxAsync(GridCacheSharedContext.java:1028)
> at org.apache.ignite.internal.processors.cache.transactions.TransactionProxyImpl.commit(TransactionProxyImpl.java:297)
> at org.apache.ignite.transactions.spring.SpringTransactionManager.doCommit(SpringTransactionManager.java:435)
> at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:746)
> at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:714)
> at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:532)
> at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:304)
> at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
> at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
> at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
> <... my application logic ...>
> Caused by: org.h2.jdbc.JdbcSQLException: General error: "class org.apache.ignite.IgniteCheckedException: Failed to wrap value[type=24, value=2018-12-14T13:07:30.982Z]" [50000-197]
> at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
> ... 83 common frames omitted
> Caused by: org.apache.ignite.IgniteCheckedException: Failed to wrap value[type=24, value=2018-12-14T13:07:30.982Z]
> at org.apache.ignite.internal.processors.query.h2.opt.GridH2RowDescriptor.wrap(GridH2RowDescriptor.java:271)
> at org.apache.ignite.internal.processors.query.h2.opt.GridH2KeyValueRowOnheap.getValue0(GridH2KeyValueRowOnheap.java:135)
> ... 80 common frames omitted
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)