if (!dbSerializerName.equals(name)) {
ORecordSerializer ser = ORecordSerializerFactory.instance().getFormat(name);
ONetworkThreadLocalSerializer.setNetworkSerializer(ser);
}
final OCommandRequestText command = (OCommandRequestText) OStreamSerializerAnyStreamable.INSTANCE.fromStream(channel
.readBytes());
ONetworkThreadLocalSerializer.setNetworkSerializer(null);
connection.data.commandDetail = command.getText();
// ENABLES THE CACHE TO IMPROVE PERFORMANCE OF COMPLEX COMMANDS LIKE TRAVERSE
// connection.database.getLocalCache().setEnable(true);
beginResponse();
try {
final OAbstractCommandResultListener listener;
if (asynch) {
listener = new OAsyncCommandResultListener(this, clientTxId, command.getResultListener());
command.setResultListener(listener);
} else
listener = new OSyncCommandResultListener();
final long serverTimeout = OGlobalConfiguration.COMMAND_TIMEOUT.getValueAsLong();
if (serverTimeout > 0 && command.getTimeoutTime() > serverTimeout)
// FORCE THE SERVER'S TIMEOUT
command.setTimeout(serverTimeout, command.getTimeoutStrategy());
if (!isConnectionAlive())
return;
// ASSIGNED THE PARSED FETCHPLAN
listener.setFetchPlan(connection.database.command(command).getFetchPlan());
final Object result = connection.database.command(command).execute();
// FETCHPLAN HAS TO BE ASSIGNED AGAIN, because it can be changed by SQL statement
listener.setFetchPlan(command.getFetchPlan());
if (asynch) {
// ASYNCHRONOUS
if (listener.isEmpty())
try {