diff --git a/src/Gemstone.Data/AdoDataConnection.cs b/src/Gemstone.Data/AdoDataConnection.cs index 9eaa75d3d..c0e150ddc 100644 --- a/src/Gemstone.Data/AdoDataConnection.cs +++ b/src/Gemstone.Data/AdoDataConnection.cs @@ -1181,11 +1181,14 @@ public async IAsyncEnumerable RetrieveDataAsAsyncEnumerable(DataTable s if (!reader.HasRows) yield break; + // Clone schema so concurrent callers sharing the same schema instance do not share row storage + DataTable table = schema.Clone(); + while (await reader.ReadAsync(cancellationToken).ConfigureAwait(false)) { - DataRow row = schema.NewRow(); + DataRow row = table.NewRow(); - foreach (DataColumn col in schema.Columns) + foreach (DataColumn col in table.Columns) row[col.ColumnName] = reader[col.ColumnName]; yield return row;