Can't open Sage Connection using .Net ConnectionManager and EntityFramework

I need to be able to read the Sage DB using EntityFramework (EF), and The SDK Connection Manager.

Other users are currently working with this company. You may open the company in multi-user mode or wait for the other users to stop using the company and try again.

My flow is like this:

  1. SDKInstanceManager.Instance.OpenDatabase(file, user, pass, true, "app name", "code", 1).
  2. Open EF connection to MySQL
  3. Close EF connection to MySQL.
  4. SDKInstanceManager.Instance.OpenDatabase(file, user, pass, true, "app name", "code", 1).
  5. User performs some tasks in my application.
  6. SDKInstanceManager.Instance.OpenDatabase() => FAILS.

If I use the same user for the SDK and for EF, I get an exception saying that a user with this application already has the DB open.

If I use seperate users for the SDK and for EF, I get an exception saying that a user with this application already has the DB open.

How can I solve this? I thought about just never closing the SDK connection, but the problem is that if I would not be able to handle the user changing their user/password in the settings of my application.

Please advise.

Parents Reply Children