| Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date | |
| All threads index page 1 | |
Hi.. Happy new year to all. Currently I use Qt4 SQL classes. I can't find anything about QtSql and threads support in Qt docs.. So looks like it isn't thread safe. So is it any way to use QtSql classes (I need only QSqlQuery) from more than one threads? Will it work if I will use 2 QtSqlDatabase instances? -- [ signature omitted ]
Attachment:
signature.asc
Description: Digital signature
Hi, > > Currently I use Qt4 SQL classes. I can't find anything about QtSql and > threads support in Qt docs.. So looks like it isn't thread safe. Have a look at this "Threads and the SQL Module" paragraph: http://doc.trolltech.com/4.2/threads.html#threads-and-the-sql-module Also thread-safe functions are identified as such in the QSqlDatabase documentation page: http://doc.trolltech.com/4.2/qsqldatabase.html -- [ signature omitted ]
On Tue, Jan 02, 2007 at 12:51:19AM +0100, Dimitri wrote: > Hi, > > > > >Currently I use Qt4 SQL classes. I can't find anything about QtSql and > >threads support in Qt docs.. So looks like it isn't thread safe. > > Have a look at this "Threads and the SQL Module" paragraph: > http://doc.trolltech.com/4.2/threads.html#threads-and-the-sql-module > > Also thread-safe functions are identified as such in the QSqlDatabase > documentation page: > http://doc.trolltech.com/4.2/qsqldatabase.html > Oops.. So looks like i can Just do QSqlDatabase::clone() and then use new database instance in second thread. -- [ signature omitted ]
Attachment:
signature.asc
Description: Digital signature