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

Ask Your Question
0

Subqueries/Nested queries does not work in Polling Container

Below query does not work

@EventTemplate SQLQuery<jobevent> matchingJobs() {

SQLQuery<JobEvent> jobevent = new SQLQuery<JobEvent>(
        JobEvent.class,
        "uniqueIdentifier in (select uniqueIdentifier from com.primatics.common.job.gigaspaces.spaceclass.JobEvent where uniqueIdentifier='Atul')");
logger.info("complete query ["+jobevent.getSelectAllQuery()+"]");
return jobevent;

}

Query printed in logs is

SELECT * FROM com.primatics.common.job.gigaspaces.spaceclass.JobEvent WHERE uniqueIdentifier in (select uniqueIdentifier from com.primatics.common.job.gigaspaces.spaceclass.JobEvent where uniqueIdentifier='Atul')

If I execute above query in GS_UI then it do return me result, But when used in @EventTemplate method of polling container then my @SpaceDataEvent method do not get invoked.

If I can rewrite above query as below then its works fine.

@EventTemplate SQLQuery<jobevent> matchingJobs() {

  SQLQuery<JobEvent> jobevent = new SQLQuery<JobEvent>(
            JobEvent.class,
            "uniqueIdentifier='Atul'"); 
logger.info("complete query ["+jobevent.getSelectAllQuery()+"]");
return jobevent;

}

Query printed in log for above case is

SELECT * FROM com.primatics.common.job.gigaspaces.spaceclass.JobEvent WHERE uniqueIdentifier='Atul'

Can Someone tell me If its limitation on Gigaspaces side for not supporting SubQueries ?

asked 2014-03-05 12:56:48 -0500

Atul gravatar image

updated 2014-03-05 13:54:26 -0500

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

Yes,you can only use for EventTemplate SQL queries that considered simple. meaning not including: GROUP BY ORDER BY Sub queries

answered 2014-03-06 01:03:39 -0500

Ester gravatar image
edit flag offensive delete link more

Comments

Easter,

Thanks for the answer.

Atul gravatar imageAtul ( 2014-03-06 13:44:28 -0500 )edit

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: 2014-03-05 12:56:48 -0500

Seen: 128 times

Last updated: Mar 06 '14