From: | Juan Tiritas <juantiritas(at)gmail(dot)com> |
---|---|
To: | pgsql-odbc(at)lists(dot)postgresql(dot)org |
Subject: | Does the psqlodbc driver support asynchronous queries? |
Date: | 2018-11-06 13:49:33 |
Message-ID: | CABEPBqP1HHCjmVTPPXjHtMw7AvJAWK1Gu0LNc0sSM_2fB5f_tw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-odbc |
Hello everyone,
I'm trying to run asynchronous queries with unixODBC + psqlodbcw.so in
linux (RHEL5), but I can not do it.
The next code:
//-------
// Get the Async state
SQLINTEGER attrState;
SQLGetConnectAttr(hstmt, SQL_ATTR_ASYNC_ENABLE, &attrState, 0, NULL);
std::cout << "Async is set to: " << attrState << std::endl;
// Enable Async Operation - if ASYNC is not allowed, SQLSetStmtAttr
// will return an error
retcode = SQLSetStmtAttr (hstmt, SQL_ATTR_ASYNC_ENABLE,
(SQLPOINTER) SQL_ASYNC_ENABLE_ON,
SQL_IS_INTEGER);
CHECK_ERROR(retcode, "SQLSetStmtAttr(SQL_ATTR_ASYNC_ENABLE)",
hstmt, SQL_HANDLE_STMT);
// Get the Async state again
SQLGetConnectAttr(hstmt, SQL_ATTR_ASYNC_ENABLE, &attrState, 0, NULL);
std::cout << "Async is set to: " << attrState << " now " << std::endl;
// Execute SELECT whilst status SQL_STILL_EXECUTING
//retcode = SQLExecDirect (hstmt, stmt, SQL_NTS);
while (SQLExecDirect (hstmt, stmt, SQL_NTS) == SQL_STILL_EXECUTING) {
printf ("\nStill executing ...");
printf ("\nSnooze ..");
sleep(1);
printf ("\nAwake ..");
retcode = SQLExecDirect (hstmt, stmt, SQL_NTS);
}
//-------
Returns the next output:
Async is set to: -1074166952
Async is set to: -1074166952 now
and the select is not working in asynchronous mode.
Am I doing something wrong or the postgres odbc driver does not support
asynchronous calls through unixODBC?
Thanks in advance.
Regards,
Juan Tiritas
From | Date | Subject | |
---|---|---|---|
Next Message | Markus Angst | 2018-11-06 16:10:27 | Re: Out of memory while reading tuples |
Previous Message | Inoue, Hiroshi | 2018-11-06 12:17:36 | Re: Out of memory while reading tuples |