Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

SQLQuery problem "or" statement

java.lang.ClassCastException: com.j_spaces.kernel.list.MultiStoredList cannot be cast to com.j_spaces.core.cache.IExtendedIndexIterator

I try to excute SQLQuery: (id in (?,?,?) and state.value = ? and (expireTime > ? or expireTime is null)) id - java.lang.Long state - Enumeration expireTime - java.util.Date

Problem is with +"or"+ statement. I have exception:

StackTrace: com.j_spaces.core.client.sql.SQLQueryException: Failed to execute SQLQuery : (id in (?,?,?) and state.value = ? and (expireTime > ? or expireTime is null)) at com.j_spaces.core.client.sql.QueryManager.readTake(QueryManager.java:203) at com.j_spaces.core.client.sql.QueryManager.readMultiple(QueryManager.java:162) at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplReadMultipleAction.readMultiple(SpaceProxyImplReadMultipleAction.java:58) at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplReadMultipleAction.executeInternal(SpaceProxyImplReadMultipleAction.java:32) at com.gigaspaces.internal.client.spaceproxy.actions.ReadTakeMultipleProxyAction.execute(ReadTakeMultipleProxyAction.java:62) at com.gigaspaces.internal.client.spaceproxy.actions.AbstractSpaceProxyActionManager.readMultiple(AbstractSpaceProxyActionManager.java:221) at com.gigaspaces.internal.client.spaceproxy.AbstractSpaceProxy.readMultiple(AbstractSpaceProxy.java:275) at org.openspaces.core.DefaultGigaSpace.readMultiple(DefaultGigaSpace.java:506) at org.openspaces.core.DefaultGigaSpace.readMultiple(DefaultGigaSpace.java:500) <...> Caused by: java.sql.SQLException: Select failed; Cause: java.sql.SQLException: Failed to execute readMultiple: com.gigaspaces.client.ReadMultipleException: Success:0, errors:1, [class java.lang.ClassCastException:1 StackTrace: java.lang.ClassCastException: com.j_spaces.kernel.list.MultiStoredList cannot be cast to com.j_spaces.core.cache.IExtendedIndexIterator at com.gigaspaces.internal.query.CompoundAndIndexScanner.getIndexedEntriesByType(CompoundAndIndexScanner.java:80) at com.gigaspaces.internal.query.CompoundOrIndexScanner.getIndexedEntriesByType(CompoundOrIndexScanner.java:60) at com.j_spaces.core.cache.CacheManager.getEntriesMinIndexExtended(CacheManager.java:3937) at com.j_spaces.core.cache.CacheManager.getScannableEntriesMinIndexExtended(CacheManager.java:3993) at com.j_spaces.core.cache.CacheManager.getMatchingMemoryEntriesForScanning(CacheManager.java:1386) at com.gigaspaces.internal.server.space.SpaceEngine.getMatchedEntriesAndOperateSA_Type(SpaceEngine.java:3818) at com.gigaspaces.internal.server.space.SpaceEngine.executeOnMatchingEntries(SpaceEngine.java:3694) at com.gigaspaces.internal.server.space.SpaceEngine.readMultiple(SpaceEngine.java:1881) at com.gigaspaces.internal.server.space.SpaceImpl.readMultiple(SpaceImpl.java:1786) at com.gigaspaces.internal.lrmi.stubs.LRMISpaceImpl.readMultiple(LRMISpaceImpl.java:267) at com.gigaspaces.internal.client.spaceproxy.SpaceProxyImpl.internalReadMultiple(SpaceProxyImpl.java:2092) at com.gigaspaces.internal.client.spaceproxy.SpaceProxyImpl.readMultipleBasic(SpaceProxyImpl.java:2026) at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplReadMultipleAction.readMultiple(SpaceProxyImplReadMultipleAction.java:84) at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplReadMultipleAction.executeInternal(SpaceProxyImplReadMultipleAction.java:32) at com.gigaspaces.internal.client.spaceproxy.actions.ReadTakeMultipleProxyAction.execute(ReadTakeMultipleProxyAction.java:62) at com.gigaspaces.internal.client.spaceproxy.actions.AbstractSpaceProxyActionManager.readMultiple(AbstractSpaceProxyActionManager.java:221) at com.gigaspaces.internal.client.spaceproxy.AbstractSpaceProxy.readMultiple(AbstractSpaceProxy.java:275) at com.j_spaces.jdbc.builder.QueryTemplatePacket.read(QueryTemplatePacket.java:485) at com.j_spaces.jdbc.builder.UnionTemplatePacket.read(UnionTemplatePacket.java:172) at com.j_spaces.jdbc.builder.QueryTemplatePacket.read(QueryTemplatePacket.java:464) at com.j_spaces.jdbc.executor.AbstractQueryExecutor.executeTemplate(AbstractQueryExecutor.java:226) at com.j_spaces.jdbc.executor.QueryExecutor.execute(QueryExecutor.java:114) at com.j_spaces.jdbc.parser.AndNode.accept(AndNode.java:69) at com.j_spaces.jdbc.executor.AbstractQueryExecutor.traverseExpressionTree(AbstractQueryExecutor.java:174) at com.j_spaces.jdbc.executor.QueryExecutor.execute(QueryExecutor.java:296) at com.j_spaces.jdbc.SelectQuery.executeQuery(SelectQuery.java:382) at com.j_spaces.jdbc.SelectQuery.executeOnSpace(SelectQuery.java:243) at com.j_spaces.core.client.sql.QueryManager.readTake(QueryManager.java:197) at com.j_spaces.core.client.sql.QueryManager.readMultiple(QueryManager.java:162) at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplReadMultipleAction.readMultiple(SpaceProxyImplReadMultipleAction.java:58) at com.gigaspaces.internal.client.spaceproxy.actions.SpaceProxyImplReadMultipleAction.executeInternal(SpaceProxyImplReadMultipleAction.java:32) at com.gigaspaces.internal.client.spaceproxy.actions.ReadTakeMultipleProxyAction.execute(ReadTakeMultipleProxyAction.java:62) at com.gigaspaces.internal.client.spaceproxy.actions.AbstractSpaceProxyActionManager.readMultiple(AbstractSpaceProxyActionManager.java:221) at com.gigaspaces.internal.client.spaceproxy.AbstractSpaceProxy.readMultiple(AbstractSpaceProxy.java:275) at org.openspaces.core.DefaultGigaSpace.readMultiple(DefaultGigaSpace.java:506) at org.openspaces.core.DefaultGigaSpace.readMultiple(DefaultGigaSpace.java:500)

Without "or" statement query works fine.

System Environment: System: OS Name: Windows 7 OS Version: 6.1 Architecture: amd64 Number Of Processors: 4 JVM Details: Java Version: 1.6.0_24, Sun Microsystems Inc. Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_24-b07) Java VM: Java HotSpot(TM) 64-Bit Server VM 19.1-b02, Sun Microsystems Inc. Java Home: C:\Java\jdk1.6.0_24_64\jre JVM Memory: Max Heap Size (KB): 466048 Current Allocated Heap Size (KB): 109554 Network Interfaces Information: <...> Zones: N/A Process Id: 4352 GigaSpaces Platform: Edition: XAP Premium 8.0.4 GA Build: 5800 Home: <...>

Edited by: atmega on Oct 21, 2011 3:21 AM

Edited by: atmega on Oct 21, 2011 5:14 AM

Edited by: atmega on Oct 21, 2011 5:31 AM

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=3770]{quote}

asked 2011-10-21 03:18:44 -0500

atmega gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

This probably relates to the known issue which is fixed in 8.0.4.2.
GS-9574: ClassCastException is thrown when running a query with X AND Y - where either X or Y have an OR condition and the fields are indexed.

You should download the latest 8.0.4.2 build from the site.

Eitan.

answered 2011-10-21 05:40:21 -0500

eitany gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2011-10-21 03:18:44 -0500

Seen: 83 times

Last updated: Oct 21 '11