ODBCDatabase query is already in progress error

Greetings,

I’m trying to connect to a Microsoft SQL server and to do multiple queries for processing from it.

I do all the code , write all in one worker and if I select more than 1 thread I get Database exception with the error “a query is already in progress” Being a DB Server that was not supposed to allow multiple connections to the server ? or is this restricted to 1 connection ?

Is this Microsoft error or ODBC Driver error or XOJO Error ?

Thanks.

By default, MS SQL Server allows something like 32000 simultaneous connexions. This is however configurable in SSMS, in server properties / connexions. Perhaps someone set the maximum connexions to 1. That would be very surprising, but worth a check.

Hope this helps. LD

Hello, well still mine is set to 0 which based on the settings is unlimited and still does not work.

I guess is more related maybe to the ODBC Driver than the server maybe and as the XOJO driver is useless and does not work in this case this makes it a dead end.

So far no idea why, I try to get data from a database and around 450 MB of data the app simply crashes with no reason. I’ll have to dig to see if it is because of Server side or Xojo side.

If you want to start a new querry while another one is still running, you need to open a new connection to the server.

It‘s not restricted to 1 connection, but each connection can only be used for 1 querry at a time.

this is what I was trying to do now but apparently I have another issue, the app is build for 64 Bit but once the Ram reaches to around 2100 Gb it simply crashes the app, no idea if related or not, the pc has 16 Gb ram and that is not a problem , I thought that 64 Bit have no issues with memory , or I guess something else left over from 32 bit.

O…M…G… :slight_smile:

Typo i guess 2100 Mb

Sounds like you are leaking memory somewhere and the OS ist killing your App because of this behaviour.
If you have no clue where in your Code this could happen, sometimes Profiling helps. Worth a try.

did not used that for long time, but as far as I remember profile report gets created and saved when there is a successful run of the app and properly closed, once app is crashed no profile is created, but I’ll try that as well, thanks.

If you are using 2021r2 or above you can call SaveProfile at any time to force the creation of a profile in the event of a crash.

2 Likes