} catch (ParseException x) {
handleJSONParseException(request, response, x.getMessage(), x.getCause());
} finally {
// If we started a batch, end it now
if (batch) {
boolean ended = session.endBatch();
// Flush session if not done by the batch, since some browser order <script> requests
if (!ended && isAlwaysFlushingAfterHandle())
session.flush();
} else if (session != null && !connect && isAlwaysFlushingAfterHandle()) {