4529 sql logger shutdown (#4530)

* enh(ThreadTest): add join test

* enh(SQLLogger): #4529 (wip)

* enh(SQLChannel): just few C++17 modernisations.

* enh(SQLiteTest): extend unit test to destroy SQL channel while it has pending messages. (#4529)

* enh(ODBC): improve exception descriptions and add string/batch size tests

* feat(SQLChannel): add store-and-forward mode

* fix(DataTest): SQLChannel *nix build and test run #4529

* fix(DataTest): CodeQL warning #4529

* chore(ODBCTest): lower the number of max statements in big batch

* feat(SQLChannel): add flush property #4529

* enh(SQLChannel): use event for interruptible sleep; reduce code duplication with lambda; update comments #4529

* fix(SQLChannel): flush time determination #4529

---------

Co-authored-by: Matej Kenda <matejken@gmail.com>
This commit is contained in:
Aleksandar Fabijanic
2024-07-16 13:03:32 -05:00
committed by GitHub
parent 2442c66f84
commit ed181d99dc
14 changed files with 724 additions and 398 deletions

View File

@@ -2480,7 +2480,7 @@ void SQLiteTest::testSQLChannel()
{
Thread::sleep(10);
if (sw.elapsedSeconds() > 3)
fail ("SQLExecutor::sqlLogger(): SQLChannel timed out");
fail ("SQLChannel timed out");
}
// bulk binding mode is not suported by SQLite, but SQLChannel should handle it internally
pChannel->setProperty("bulk", "true");
@@ -2537,6 +2537,17 @@ void SQLiteTest::testSQLChannel()
rs2.moveNext();
assertTrue("WarningSource" == rs2["Source"]);
assertTrue("f Warning sync message" == rs2["Text"]);
pChannel->setProperty("minBatch", "1024");
constexpr int mcount { 2000 };
for (int i = 0; i < mcount; i++)
{
Message msgInfG("InformationSource", "g Informational sync message", Message::PRIO_INFORMATION);
pChannel->log(msgInfG);
}
pChannel.reset();
RecordSet rsl(tmp, "SELECT * FROM T_POCO_LOG");
assertEquals(2+mcount, rsl.rowCount());
}
@@ -3513,7 +3524,7 @@ void SQLiteTest::testIllegalFilePath()
}
}
void SQLiteTest::testTransactionTypeProperty()
void SQLiteTest::testTransactionTypeProperty()
{
try {
using namespace Poco::Data::SQLite;