ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Kuznetsov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-10690) Ignite throws exception when storing an object with an Instant field
Date Fri, 26 Apr 2019 15:31:00 GMT

    [ https://issues.apache.org/jira/browse/IGNITE-10690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16827050#comment-16827050
] 

Pavel Kuznetsov commented on IGNITE-10690:
------------------------------------------

Let's add some debug info. I've modified one of SpringData tests to reproduce the issue. I
see QueryEntity created:
{code}
[keyType=java.lang.Integer, 
valType=org.apache.ignite.springdata.misc.Person, 
keyFieldName=null, 
valueFieldName=null, 
fields=LinkedHashMap 
{
    firstName=java.lang.String, 
    secondName=java.time.Instant
}, 
keyFields=HashSet [], 
aliases=HashMap {firstName=FIRSTNAME, secondName=SECONDNAME}, 
idxs=LinkedList 
[
    QueryIndex [name=PERSON_SECONDNAME_IDX, fields=LinkedHashMap {secondName=true}, type=SORTED,
inlineSize=-1], 
    QueryIndex [name=PERSON_FIRSTNAME_IDX, fields=LinkedHashMap {firstName=true}, type=SORTED,
inlineSize=-1]
],
tableName=PERSON]
{code}

> 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
>            Assignee: Pavel Kuznetsov
>            Priority: Blocker
>             Fix For: 2.8
>
>
> 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:
> 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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message