Using the sorted browser's feature does not work with time_scope (snapshot, new, all).

Using the sorted browser's feature does not work with time_scope (snapshot, new, all).

book

Article ID: KB0093465

calendar_today

Updated On:

Products Versions
TIBCO ActiveSpaces -
Not Applicable -

Description

Description:
When you try and browse a space using time_scope_all for example:

Browser b = messagesSpace.browse(BrowserDef.BrowserType.TAKE, BrowserDef.create(10000, BrowserDef.TimeScope.ALL), "order by MESSAGECREATION");

The following error occurs:

com.tibco.as.space.ASException: SYS_ERROR (bad_query - time_scope_all does not support order by)
    at Native.SpaceBrowserListener::initialize(SpaceBrowserListener.cpp:63)
    at Native.SpaceBrowser::initialize(SpaceBrowser.cpp:42)
    at Native.Api_Browser_Initialize(ApiBrowser.cpp:73)
    at Native.Api_Browser_Initialize(ApiBrowser.cpp:27)
    at Native.Java_com_tibco_as_space_impl_NativeImpl_spaceCreateQueryBrowser(JBrowser.cpp:41)
    at com.tibco.as.space.impl.NativeImpl.spaceCreateQueryBrowser(Native Method)
    at com.tibco.as.space.impl.ASSpace.browse(ASSpace.java:506)

Symptoms:
com.tibco.as.space.ASException: SYS_ERROR (bad_query - time_scope_all does not support order by)
    at Native.SpaceBrowserListener::initialize(SpaceBrowserListener.cpp:63)
    at Native.SpaceBrowser::initialize(SpaceBrowser.cpp:42)
    at Native.Api_Browser_Initialize(ApiBrowser.cpp:73)
    at Native.Api_Browser_Initialize(ApiBrowser.cpp:27)
    at Native.Java_com_tibco_as_space_impl_NativeImpl_spaceCreateQueryBrowser(JBrowser.cpp:41)
    at com.tibco.as.space.impl.NativeImpl.spaceCreateQueryBrowser(Native Method)
    at com.tibco.as.space.impl.ASSpace.browse(ASSpace.java:506)
Cause:
Order by is not supported by these functions:

-time_scope_snapshot
-time_scope_new
-time_scope_all

Resolution

Modify the code application to use CURRENT. For example:

Browser b = messagesSpace.browse(BrowserDef.BrowserType.TAKE, BrowserDef.create(10000, BrowserDef.TimeScope.CURRENT), "order by MESSAGECREATION");

Time scopes are used to narrow the period of time of interest. CURRENT allows client applications to create queries that return large result sets using less resources.

ALL = SNAPSHOT + NEW.

CURRENT retrieves all data from ALL and sorts it in the order required.

Issue/Introduction

Using the sorted browser's feature does not work with time_scope (snapshot, new, all).