I am fetching some data of multiple stations from SAP via named query. In one of query I am checking if COUNT(*) >0 where current time > currentTime-15mins. I am polling this query every 15 mins. There is a buzzer which goes ON when the is count>0. Operator Ack the buzzer which puts it to silent. I am passing station Name as parameter to the query.
Now what happens is If I am looking data of STN05 and say there is count>0 hence Buzzer goes ON, Operator ACK’d and buzzer is now OFF. Now Operator changed STN05 to STN08 and then returned to STN05. This causes the count >0 and make the Buzzer ON again.
Is it possible to not fire SQL named query when the STN selection changes? OR
Is it possible to get last query fired timestamp?
Please suggest a way to achieve this.