Two sql queries on MySQL server at the same time

When I try to run two queries at the same time, I got this message:

Database Exception: A query is already in progress

One query is running on a thread and the other one are done in a window without a thread.

You need another connection, are you opening a different connection for another parallel set of commands?

the same user and a new db.connect?

No. You need a new db object.


which would required its own DB connection

Okay, I will try it.

NEVER share a single connection across threads
Its a recipe for problems like you’re having (or, worse, interleaved results)

I think, read values from different tables should not be a problem.

Same connection needs queuing, so it destroys the idea of parallelism.

Not. At. All.

If you use your DB with other (3rd Party) Apps, check the connections in the Admin Module of your DB. It’s normal that Apps use multiple connections to a DB.

If you f.e. need the RowSets out side of a Thread in which you do your query, create a new DB Object in the Thread and use a RowSet Property in the Window, Module, … And while you do your query within this Thread, you can user other DB Objects/Properties to do other queries at the same time. But also use a different RowSet Object for each parallel working query. :slight_smile:

Just make sure that RowSets and DB Connections which are no longer needed will be “closed” properly.

As the error message already says, it’s not ok. There can only be 1 query per connection at one time.