Qt-interest Archive, March 2008
Re: MySQL drivers in the Open Source Edition of Qt4
Message 1 in thread
Aha, this is specific to the mysql driver then? I was wondering about that.
I am performing the QSqlDatabase::addDatabase in a newly created
thread that is not my main thread.
Then that work thread terminates properly, but there is still that
extra thread that the QSqlDatabase::addDatabase creates, that is not
cleaned up.
Even if I do a QSqlDatabase::removeDatabase() or a db.close() before
the workthread terminates, this does not clean up the extra thread.
When the program terminates, there are N threads still running and not
terminated, that cause a long pause before program exit, and I see
this message:
Error in my_thread_global_end(): 1 threads didn't exit
I was not sure if this is a bug in the driver, or in Qt's
QSqlDatabase, but it is really annoying!
I am performing the same SQL operations from a single-threaded non-GUI
app and this problem does not reproduce, so it seems to be specific to
a QSqlDatabase connection that is created in a thread other than the
main thread.
I see this with Qt 4.3.3 as well as Qt 4.4tp1, on linux, using
mysql-client 5.0.51-3
On Tue, Feb 12, 2008 at 7:56 PM, David Fuess <david@xxxxxxxxx> wrote:
> Thank you Peter, I followed the instructions in the wiki and now have
> MySQL access from Qt on Windows.
>
> Now a follow-up question: When the program exits i get a delayed error
> *Error in my_thread_global_end(): 1 threads didn't exit
>
> *There is a lot of discussion on the net about handling this error in
> PHP but nothing referencing Qt4. Anyone know how to deal with this? I'm
> using MySQL 5.0.45.
>
>
>
> Peter E Dennis wrote:
> > My apologies to the original poster for misleading information.
> > Looking at my package manager (synaptic) I did in fact have to install
> > the sql plugins as a separate package, I am just fortunate that the
> > process is a little more transparent using pre-compiled binaries for
> > my distribution of linux.
> >
> > I will probably try qt4 out on windows as well at some stage. Some
> > useful links i just googled to see how to add the MySQL plugins
> > include:
> >
> > http://qtnode.net/wiki?title=Qt4_on_Windows
> >
> > Although the below url says linux it also has information windows.
> > http://www.rag.com.au/linux/qt4howto.html
> >
> >
> > On 13/02/2008, Andreas Pakulat <apaku@xxxxxx> wrote:
> >
> >> On 13.02.08 07:35:26, Peter E Dennis wrote:
> >>
> >>> I'm using the open source version on Ubuntu and it works "out of the
> >>> box" with MySQL. All I had to do was in one of my source files:
> >>> #include <QtSql>
> >>>
> >>> and then add to my *.pro file:
> >>> QT += sql
> >>>
> >>> copy the 'createConnection()' function used in the examples kindly
> >>> provided by Qt and away I went.
> >>>
> >>> Maybe it is more painful on Windows....
> >>>
> >> Kind of, because you have to build Qt yourself, the binary installer on
> >> windows doesn't come with the sql plugins as that would lead to TT
> >> shipping also the various client libs.
> >>
> >> But I don't see a problem in compiling Qt on win32, its one of the
> >> easiest projects to compile on both compilers.
> >>
> >> Andreas
> >>
> >>
> >> --
> >> Of course you have a purpose -- to find a purpose.
> >>
> >> --
> >> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> >> List archive and information: http://lists.trolltech.com/qt-interest/
> >>
> >>
> >>
> >
> > --
> > To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> > List archive and information: http://lists.trolltech.com/qt-interest/
> >
> >
> >
> >
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
--
[ signature omitted ]