Unable to resolve Coherence error while migrating project from TIBCO BusinessEvents 4.0 to BusinessEvents 5.1.1

Unable to resolve Coherence error while migrating project from TIBCO BusinessEvents 4.0 to BusinessEvents 5.1.1

book

Article ID: KB0087597

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition -
Not Applicable -

Description

Resolution:
Description:
============
Unable to resolve Coherence error while migrating project from TIBCO BusinessEvents 4.0 to BusinessEvents 5.1.1

Environment:
============
TIBCO BusinessEvents  5.1.1

Resolution:
============
Use a collocated query with dynamic query session while migrating from BusinessEvents 4.x to BusinessEvents 5.x as Active Spaces does not provide the same application program interface as Coherence. Below is an example of a dynamic query session. For a dynamic query session example you would not need to explicitly create a Query Agent.

Following can be used for querying:
----------------------------------------------------------------
        String queryString = "select {limit: first 5} c" +
                    " from /Concepts/Common/Customer as c" +
                    " where c.age = 4" +
                    " order by c@id desc;";
        
        Object resultList = Query.Util.executeInDynamicQuerySession(queryString, null, true);
        System.debugOut("Retrieved [" + Query.Util.sizeOfList(resultList) + "] customers using [" + queryString + "]");
        
        
        
For iterating over the result set you can use the following:
----------------------------------------------------------------
        while(Query.Util.sizeOfList(resultList) > 0){
            Concepts.Common.Customer c = Query.Util.removeFromList(resultList, 0);

            /*
            Before modifying the concept retrieved from the query agent, inform the
            inference that this came from a foreign source.
            */
            Cluster.DataGrid.CacheLoadEntity(c);
            /*
            Typically lock + query + load should be done in the pre-processor
            after acquiring the necessary locks. So, we re-touch the instance
            by using Instance.getById()
            */
            c = Instance.getById(c@id);
            
            String oldName = c.name;
            c.name = c.name + ":__mod@" + System.currentTimeMillis();
            
            System.debugOut("Modified [" + oldName + ", " + c.age + "] name to: [" + c.name + "]");            
        }                
        System.debugOut("Done retrieving and modifying customers");

The main advantages of using structured query language (SQL) style querying in Active Spaces are maintainability and readability.

The collocated query engine is embedded inside the inference engine and would not require a separate processing unit.

Issue/Introduction

Unable to resolve Coherence error while migrating project from TIBCO BusinessEvents 4.0 to BusinessEvents 5.1.1