From 4385c6bae1a66aa94beb703dcc16e12bdf0ebb0e Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 13 Aug 2015 22:43:36 +0200 Subject: Autocommit for the transaction --- tests/storagebenchmark.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/storagebenchmark.cpp b/tests/storagebenchmark.cpp index fba72ad..ce1005d 100644 --- a/tests/storagebenchmark.cpp +++ b/tests/storagebenchmark.cpp @@ -97,14 +97,8 @@ private Q_SLOTS: auto event = createEvent(); if (store) { auto transaction = store->createTransaction(Akonadi2::Storage::ReadWrite); + transaction.setAutocommit(10000); for (int i = 0; i < count; i++) { - if (i % 10000 == 0) { - if (i > 0) { - transaction.commit(); - transaction = std::move(store->createTransaction(Akonadi2::Storage::ReadWrite)); - } - } - transaction.write(keyPrefix + QByteArray::number(i), event); } transaction.commit(); -- cgit v1.2.3