diff options
-rw-r--r-- | project2/sql/sqlBulkLoad.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/project2/sql/sqlBulkLoad.cpp b/project2/sql/sqlBulkLoad.cpp index 4d9604a..b26b0c8 100644 --- a/project2/sql/sqlBulkLoad.cpp +++ b/project2/sql/sqlBulkLoad.cpp @@ -23,11 +23,12 @@ class SqlBulkLoad : public Task { void execute() const { - db->getWritable().beginBulkUpload(targetTable(), extras()); + const DB::Connection & wdb = db->getWritable(); + wdb.beginBulkUpload(targetTable(), extras()); ScopeObject tidy([]{}, - [=]{ db->getWritable().endBulkUpload(NULL); }, - [=]{ db->getWritable().endBulkUpload("Stack unwind in progress"); }); - stream->runStream(boost::bind(&DB::Connection::bulkUploadData, &db->getWritable(), _1, _2)); + [&]{ wdb.endBulkUpload(NULL); }, + [&]{ wdb.endBulkUpload("Stack unwind in progress"); }); + stream->runStream(boost::bind(&DB::Connection::bulkUploadData, &wdb, _1, _2)); } const Variable dataSource; |