Page 1 of 1

Database is already open and can only have one user...

Posted: Tue 22 Jul 2008 14:10
by Antero
SDAC 4.50.0.35
Delphi 2006

I try to update database. First I set database option SINGLE_USER, then I try to run hundreds of SQL commands. I use only one TMSConnection. After a few minutes of updating comes sometimes the exception "Database 'updatetest' is already open and can only have one user at a time." This exception is not dependent on last command, it is totally random.

Do you have any idea why this exception comes?

Thanks,
Antero

Posted: Wed 23 Jul 2008 07:09
by Antaeus
Probably the error happens when SDAC tries to establish additional connections to the server (e.g. FetchAll=False mode, NonBlocking=True mode). Try to enable the MultipleActiveResultSets option in TMSConnection. See description of MultipleActiveResultSets in the SDAC help.