final List<OIdentifiable> response;
try {
db = getProfiledDatabaseInstance(iRequest);
final OQueryAbstract command = new OSQLSynchQuery<ODocument>(text, limit).setFetchPlan(fetchPlan);
response = (List<OIdentifiable>) db.query(command);
fetchPlan = command.getFetchPlan();
iResponse.writeRecords(response, fetchPlan);
} finally {
if (db != null)