Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About qx::QxDaoAsync #109

Open
venjin opened this issue Sep 27, 2023 · 6 comments
Open

About qx::QxDaoAsync #109

venjin opened this issue Sep 27, 2023 · 6 comments

Comments

@venjin
Copy link

venjin commented Sep 27, 2023

My code is:

    connect(daoAsync.get(), &qx::QxDaoAsync::queryFinished, this, &DatabaseAccessor::onQueryFinished, Qt::UniqueConnection);
    daoAsync->asyncCount("BlacklistItem", qx::QxSqlQuery(),  &_db);

Error occur when run:

QxOrm] execute sql query failed : SELECT COUNT(*) FROM ea_process_blacklist
Database error number '
1046' : 
QMYSQL: Unable to execute query

No database selected
QSqlDatabasePrivate::removeDatabase: connection '{b0c066c0-7c15-497e-b251-688552b9b78f}' is still in use, all queries will cease to work.
onQueryFinished QSqlError("\n1046", "\nQMYSQL: Unable to execute query", "\nNo database selected") 0

What's wrong?

@venjin
Copy link
Author

venjin commented Sep 28, 2023

I have found the reason, because the database is not open after clone in QxDaoAsyncRunner::runQuery

@QxOrm
Copy link
Owner

QxOrm commented Oct 2, 2023

Hello,
I don't understand : is there an issue on QxOrm side, or is it on your code ?
If this is an issue on QxOrm library : do you have a fix or a patch to submit ?
Thx !

@venjin
Copy link
Author

venjin commented Oct 2, 2023

On the qxorm side. The database is not open after clone in QxDaoAsyncRunner::runQuery, when i add
'''cpp
db.open();
'''
The error will disapear.

@venjin
Copy link
Author

venjin commented Oct 2, 2023

I just fix the bug on my local source code, not take an issuer or a submit.

@QxOrm
Copy link
Owner

QxOrm commented Oct 2, 2023

Ok thx, I will check that and provide your fix for the next release if I'm able to reproduce :)

@venjin
Copy link
Author

venjin commented Oct 2, 2023

Ok thanks a lot!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants