Beispiel #1
0
        /**
         * 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 executeCallback execute callback
         * @param <T> class type of return value
         * @return result
         * @throws SQLException SQL exception
         */
        protected List <T> ExecuteCallback <T>(SqlExecuteCallback <T> executeCallback)
        {
            List <T> result = SqlExecuteTemplate.Execute(InputGroups, executeCallback);

            refreshMetaDataIfNeeded(Connection.GetRuntimeContext(), SqlCommandContext);
            return(result);
        }
Beispiel #2
0
        public AbstractCommandExecutor(ShardingConnection shardingConnection)
        {
            this.DatabaseType = shardingConnection.GetRuntimeContext().GetDatabaseType();
            this.Connection   = shardingConnection;
            // int maxConnectionsSizePerQuery = connection.GetRuntimeContext().GetProperties().<Integer>getValue(ConfigurationPropertyKey.MAX_CONNECTIONS_SIZE_PER_QUERY);
            int            maxConnectionsSizePerQuery = 1;
            ExecutorEngine executorEngine             = Connection.GetRuntimeContext().GetExecutorEngine();

            SqlExecutePrepareTemplate = new SqlExecutePrepareTemplate(maxConnectionsSizePerQuery);
            SqlExecuteTemplate        = new SqlExecuteTemplate(executorEngine, Connection.IsHoldTransaction());
        }