[ whitefrost.com | Account Manager 4 Product Page ]

Core.Data.SqlBulkInsert Class Reference

SqlBulkInsert is a thread-safe class for spooling SQL insert queries against an existing schema. It is made thread-safe by locking Add, Insert, and Clear invocations against the is_inserting bool; Locking the table object or table.Rows collection is ineffective The schema may be optionally cached to disk for repeated use. The implementing class should only need to add as many entries as desired using the Add method, and if Auto-insert is enabled, the Insert method is auto-invoked when the 'BulkSize' property is reached. Invoking Insert causes the spooled datarows to be bulkcopied into the target database. More...

Inheritance diagram for Core.Data.SqlBulkInsert:

Core.Data.SqlBulkInsertFaux

List of all members.

Public Member Functions

 SqlBulkInsert (String in_connection_string, String in_table_name)
 SqlBulkInsert (Core.Interfaces.IDataProvider provider, String in_table_name)
 SqlBulkInsert (String in_connection_string, String in_table_name, String in_persist_path)
bool Prepare ()
bool Insert ()
bool AddRow (DataRow row)
DataRow NewRow ()
void Clear ()
 SqlBulkInsert (String in_connection_string, String in_table_name)
 SqlBulkInsert (String in_connection_string, String in_table_name, String in_persist_path)
 SqlBulkInsert (Core.Interfaces.IDataProvider provider, String in_table_name)

Properties

Core.Data.DbFactory.CONNECTION_TYPE DatabaseType [get, set]
WindowsIdentity ImpersonationIdentity [get, set]
int CurrentSize [get]
int TotalCopied [get]
bool AutoInsert [get, set]
int BulkSize [get, set]
int BatchSize [get, set]
DataTable Table [get, set]
bool PersistSchemaLocally [get, set]
bool PersistSchema [get, set]
String PersistantSchemaPath [get, set]
String PersistantSchema [get, set]
String ConnectionString [get, set]
String TableName [get, set]

Private Attributes

String connection_string = null
String table_name = null
String persistant_schema_path = null
String persistant_schema = null
bool persist_schema = false
bool persist_schema_locally = false
DataTable table
int bulk_size = 20
int batch_size = 10
int current_size = 0
int total_copied = 0
bool auto_insert = false
bool is_inserting = false
WindowsIdentity impersonation_identity = null
Core.Data.DbFactory.CONNECTION_TYPE database_type = DbFactory.CONNECTION_TYPE.SQL
Core.Interfaces.IDataProvider data_provider = null


Detailed Description

SqlBulkInsert is a thread-safe class for spooling SQL insert queries against an existing schema. It is made thread-safe by locking Add, Insert, and Clear invocations against the is_inserting bool; Locking the table object or table.Rows collection is ineffective The schema may be optionally cached to disk for repeated use. The implementing class should only need to add as many entries as desired using the Add method, and if Auto-insert is enabled, the Insert method is auto-invoked when the 'BulkSize' property is reached. Invoking Insert causes the spooled datarows to be bulkcopied into the target database.

BulkInsertBridge is a bridge class that maps BulkInsert to BulkInsertFaux. This was added while issues with the SqlBulkInsert class and Mono are sorted out.


Constructor & Destructor Documentation

Core.Data.SqlBulkInsert.SqlBulkInsert ( String  in_connection_string,
String  in_table_name 
)

Core.Data.SqlBulkInsert.SqlBulkInsert ( Core.Interfaces.IDataProvider  provider,
String  in_table_name 
)

Core.Data.SqlBulkInsert.SqlBulkInsert ( String  in_connection_string,
String  in_table_name,
String  in_persist_path 
)

Core.Data.SqlBulkInsert.SqlBulkInsert ( String  in_connection_string,
String  in_table_name 
)

Core.Data.SqlBulkInsert.SqlBulkInsert ( String  in_connection_string,
String  in_table_name,
String  in_persist_path 
)

Core.Data.SqlBulkInsert.SqlBulkInsert ( Core.Interfaces.IDataProvider  provider,
String  in_table_name 
)


Member Function Documentation

bool Core.Data.SqlBulkInsert.Prepare (  ) 

connection.Close();

Reimplemented from Core.Data.SqlBulkInsertFaux.

bool Core.Data.SqlBulkInsert.Insert (  ) 

connection.Close();

Reimplemented from Core.Data.SqlBulkInsertFaux.

bool Core.Data.SqlBulkInsert.AddRow ( DataRow  row  ) 

Reimplemented from Core.Data.SqlBulkInsertFaux.

DataRow Core.Data.SqlBulkInsert.NewRow (  ) 

Reimplemented from Core.Data.SqlBulkInsertFaux.

void Core.Data.SqlBulkInsert.Clear (  ) 

Reimplemented from Core.Data.SqlBulkInsertFaux.


Member Data Documentation

Reimplemented from Core.Data.SqlBulkInsertFaux.

String Core.Data.SqlBulkInsert.table_name = null [private]

Reimplemented from Core.Data.SqlBulkInsertFaux.

Reimplemented from Core.Data.SqlBulkInsertFaux.

Reimplemented from Core.Data.SqlBulkInsertFaux.

Reimplemented from Core.Data.SqlBulkInsertFaux.

Reimplemented from Core.Data.SqlBulkInsertFaux.

DataTable Core.Data.SqlBulkInsert.table [private]

Reimplemented from Core.Data.SqlBulkInsertFaux.

Reimplemented from Core.Data.SqlBulkInsertFaux.

Reimplemented from Core.Data.SqlBulkInsertFaux.

Reimplemented from Core.Data.SqlBulkInsertFaux.

Reimplemented from Core.Data.SqlBulkInsertFaux.

bool Core.Data.SqlBulkInsert.auto_insert = false [private]

Reimplemented from Core.Data.SqlBulkInsertFaux.

bool Core.Data.SqlBulkInsert.is_inserting = false [private]

Reimplemented from Core.Data.SqlBulkInsertFaux.

WindowsIdentity Core.Data.SqlBulkInsert.impersonation_identity = null [private]

Reimplemented from Core.Data.SqlBulkInsertFaux.

Reimplemented from Core.Data.SqlBulkInsertFaux.

Reimplemented from Core.Data.SqlBulkInsertFaux.


Property Documentation

Core.Data.DbFactory.CONNECTION_TYPE Core.Data.SqlBulkInsert.DatabaseType [get, set]

Reimplemented from Core.Data.SqlBulkInsertFaux.

WindowsIdentity Core.Data.SqlBulkInsert.ImpersonationIdentity [get, set]

Reimplemented from Core.Data.SqlBulkInsertFaux.

int Core.Data.SqlBulkInsert.CurrentSize [get]

Reimplemented from Core.Data.SqlBulkInsertFaux.

int Core.Data.SqlBulkInsert.TotalCopied [get]

Reimplemented from Core.Data.SqlBulkInsertFaux.

bool Core.Data.SqlBulkInsert.AutoInsert [get, set]

Reimplemented from Core.Data.SqlBulkInsertFaux.

int Core.Data.SqlBulkInsert.BulkSize [get, set]

Reimplemented from Core.Data.SqlBulkInsertFaux.

int Core.Data.SqlBulkInsert.BatchSize [get, set]

Reimplemented from Core.Data.SqlBulkInsertFaux.

DataTable Core.Data.SqlBulkInsert.Table [get, set]

Reimplemented from Core.Data.SqlBulkInsertFaux.

bool Core.Data.SqlBulkInsert.PersistSchemaLocally [get, set]

Reimplemented from Core.Data.SqlBulkInsertFaux.

bool Core.Data.SqlBulkInsert.PersistSchema [get, set]

Reimplemented from Core.Data.SqlBulkInsertFaux.

String Core.Data.SqlBulkInsert.PersistantSchemaPath [get, set]

Reimplemented from Core.Data.SqlBulkInsertFaux.

String Core.Data.SqlBulkInsert.PersistantSchema [get, set]

Reimplemented from Core.Data.SqlBulkInsertFaux.

String Core.Data.SqlBulkInsert.ConnectionString [get, set]

Reimplemented from Core.Data.SqlBulkInsertFaux.

String Core.Data.SqlBulkInsert.TableName [get, set]

Reimplemented from Core.Data.SqlBulkInsertFaux.


The documentation for this class was generated from the following files:
Stephen W. Cote, 2009, whitefrost.com