Click here to Skip to main content
15,889,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I need to execute sql queries in asynchronous manner.
Any examples ?
Thanks in advice.
Irek.
Posted

1 solution

Hi iron,
For exampple it is possible to do with C++/Qt....
Sometimes, it's necessary to execute some queries to database in asynchronous way (multi-thread), for example to avoid to freeze a GUI if a query is too long to execute.
To make easier to work with asynchronous queries, QxOrm library provides qx::QxDaoAsync class.
This class executes a query in another thread and returns the queryFinished() SIGNAL when query is terminated.
To use qx::QxDaoAsync class, you just have to :
be careful to work only with classes implementing qx::IxPersistable interface ;
create an instance of qx::QxDaoAsync type (for example, a property of a QWidget derived class) ;
connect a SLOT to the qx::QxDaoAsync::queryFinished() SIGNAL (for example, a SLOT of a QWidget derived class) ;
run a query using one of qx::QxDaoAsync::asyncXXXX() methods.

Please see here: http://www.qxorm.com/qxorm_en/faq.html#faq_290[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900