/** * Execute. * * @param inputGroups input groups * @param firstCallback first SQL execute callback * @param callback SQL execute callback * @param <T> class type of return value * @return execute result * @throws SQLException SQL exception */ public List <R> Execute <R>(ICollection <InputGroup <CommandExecuteUnit> > inputGroups, SqlExecuteCallback <R> firstCallback, SqlExecuteCallback <R> callback) { try { return(ExecutorEngine.Execute(inputGroups, firstCallback, callback, Serial)); } catch (Exception ex) { ExecutorExceptionHandler.HandleException(ex); return(new List <R>()); } }
/** * To make sure SkyWalking will be available at the next release of ShardingSphere, * a new plugin should be provided to SkyWalking project if this API changed. * * @see <a href="https://github.com/apache/skywalking/blob/master/docs/en/guides/Java-Plugin-Development-Guide.md#user-content-plugin-development-guide">Plugin Development Guide</a> * * @param statementExecuteUnit statement execute unit * @param isTrunkThread is trunk thread * @param dataMap data map * @return result * @throws SQLException SQL exception */ private T Execute0(CommandExecuteUnit commandExecuteUnit, bool isTrunkThread, IDictionary <string, object> dataMap) { ExecutorExceptionHandler.SetExceptionThrow(isExceptionThrown); IDataSourceMetaData dataSourceMetaData = GetDataSourceMetaData(commandExecuteUnit.Command); var hookManager = SqlExecutionHookManager.GetInstance(); try { ExecutionUnit executionUnit = commandExecuteUnit.ExecutionUnit; hookManager.Start(executionUnit.GetDataSourceName(), executionUnit.GetSqlUnit().GetSql(), executionUnit.GetSqlUnit().GetParameterContext(), dataSourceMetaData, isTrunkThread, dataMap); T result = OnSqlExecute(executionUnit.GetSqlUnit().GetSql(), commandExecuteUnit.Command, commandExecuteUnit.ConnectionMode); hookManager.FinishSuccess(); return(result); } catch (Exception ex) { hookManager.FinishFailure(ex); ExecutorExceptionHandler.HandleException(ex); return(default);