Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixing test + license
  • Loading branch information
Carl Meyertons committed Jul 14, 2020
commit 14a8cfa74a01a88336a06d68e5a5ef4e8dea66db
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ static GenericsBencmark()
InitialCatalog = DB,
}.ToString();

using var masterc = new SqlConnection(masterCs);
using var c = new SqlConnection(_connString);

// these were using Dapper in cmeyertons benchmark project
//using var masterc = new SqlConnection(masterCs);
//using var c = new SqlConnection(_connString);

//masterc.Execute(@$"
// DROP DATABASE IF EXISTS {DB};
// CREATE DATABASE {DB};
Expand Down Expand Up @@ -179,13 +179,14 @@ private static void BulkCopy(IDataReader reader, string tableName)
{
reader.Close(); // this resets the reader

using var bc = new SqlBulkCopy(_connString, Microsoft.Data.SqlClient.SqlBulkCopyOptions.TableLock);

bc.BatchSize = _count;
bc.DestinationTableName = tableName;
bc.BulkCopyTimeout = 60;
using (var bc = new SqlBulkCopy(_connString, SqlBulkCopyOptions.TableLock))
{
bc.BatchSize = _count;
bc.DestinationTableName = tableName;
bc.BulkCopyTimeout = 60;

bc.WriteToServer(reader);
bc.WriteToServer(reader);
}
}

//all code here and below is a custom data reader implementation to support the benchmark.
Expand Down