ignite-757 - marshalling fix
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a5c6bcf5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a5c6bcf5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a5c6bcf5 Branch: refs/heads/ignite-757 Commit: a5c6bcf5994346b6d9294d2c1ddb4a3d0c7cdabd Parents: 1556ec9 Author: S.Vladykin <svlady...@gridgain.com> Authored: Thu Apr 23 10:21:55 2015 +0300 Committer: S.Vladykin <svlady...@gridgain.com> Committed: Thu Apr 23 10:21:55 2015 +0300 ---------------------------------------------------------------------- .../processors/query/h2/IgniteH2Indexing.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a5c6bcf5/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java index 7a0a4b2..cbf74fc 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java @@ -2158,16 +2158,18 @@ public class IgniteH2Indexing implements GridQueryIndexing { /** {@inheritDoc} */ @Override public byte[] getBytesNoCopy() { - // Can't just return valueBytes for portable because it can't be unmarshalled then. - if (coctx != null && coctx.processor().isPortableObject(obj)) - return Utils.serialize(obj, null); - - try { - return obj.valueBytes(coctx); // Result must be the same: `marshaller.marshall(obj.value(coctx, false))` - } - catch (IgniteCheckedException e) { - throw DbException.convert(e); + if (obj.type() == CacheObject.TYPE_REGULAR) { + // Result must be the same as `marshaller.marshall(obj.value(coctx, false));` + try { + return obj.valueBytes(coctx); + } + catch (IgniteCheckedException e) { + throw DbException.convert(e); + } } + + // For portables and byte array cache object types. + return Utils.serialize(obj.value(coctx, false), null); } /** {@inheritDoc} */