Time Limit on Query to External Source?

  1. I query FileMaker Server, to populate a Valuelist in Servoy, but if FileMaker is busy, this can “lock up” the Method waiting for a reply

is there any way to “try” a query, with a time limit? I would like to skip the query, if busy

this seems to work:

var datestart = new Date();
var start = datestart.getTime();

var string = ‘Select 1 from Media’;

var dataset = databaseManager.getDataSetByQuery( server, string, null, -1 );
var result = dataset.getValue( 1, 1 );

var dateend = new Date();
var end = dateend.getTime();

var diff = end - start;

if the time difference in ms is large, e.g. >1200 ms, I can stop

  1. Second Question: in the method above, if I comment out the “dataset.getValue”, the query is 10x slower. Why is this?

greg

Greg,

ad 1. currently there is no query timeout supported, we could add this for databasemanager.getDataSetByQuery(), file a feature request for that.

ad 2. that is strange, you comment out code and it takes longer?
Maybe the query does not take the same time every time?

Rob