VO + C# DLL with both connecting to ADS
Posted: Tue Aug 08, 2023 2:46 pm
This is probably a bit of a long shot asking here, but I'll take my chances...
I'm running a VO application that imports some C# code via DLL. Both VO and C# are opening a connection to the same database in ADS (free tables / no data dictionary). VO is using DbServer classes and C# is mapped with Entity Framework and a connection string. The connection string is: metadata=aaa.csdl|aaa.ssdl|aaa.msl; provider = Advantage.Data.Provider; provider connection string= 'Data Source=.; CharType = ADS_OEM; DbfsUseNulls = False; LockMode = PROPRIETARY; ReadOnly = False; SecurityMode = IGNORERIGHTS; ServerType = REMOTE; Shared = True; ShowDeleted = False; TableType = CDX; TrimTrailingSpaces = True'
The problem I have is around both assemblies running within the same process space accessing the DB at the same time. Querying the database from C# seems to be killing VO's ADS connection. I get 5333's and invalid ads connection handles. VO works fine up until the C# query runs. For example if I run:
VO works fine up until that point. After that I'll get an exception when it tries to access the database on a DbServer that was opened prior to the call, and held open until afterwards. Any DbServer opened and closed prior to the call, or opened and closed after the call is fine. This bug only affects servers that remain open during the call.
Any ideas? I've been playing with Pooling=False and ConnectionHandle=<Connection I'm manually opening>, but I've had no luck as yet. I don't suppose any similar problems have been reported previously here?
I'm continuing to troubleshoot this problem. If I find any more clues I'll post them here too.
I'm running a VO application that imports some C# code via DLL. Both VO and C# are opening a connection to the same database in ADS (free tables / no data dictionary). VO is using DbServer classes and C# is mapped with Entity Framework and a connection string. The connection string is: metadata=aaa.csdl|aaa.ssdl|aaa.msl; provider = Advantage.Data.Provider; provider connection string= 'Data Source=.; CharType = ADS_OEM; DbfsUseNulls = False; LockMode = PROPRIETARY; ReadOnly = False; SecurityMode = IGNORERIGHTS; ServerType = REMOTE; Shared = True; ShowDeleted = False; TableType = CDX; TrimTrailingSpaces = True'
The problem I have is around both assemblies running within the same process space accessing the DB at the same time. Querying the database from C# seems to be killing VO's ADS connection. I get 5333's and invalid ads connection handles. VO works fine up until the C# query runs. For example if I run:
Code: Select all
Code: Select all
using (MYDB db = new MYDB())
{
var res = from lines in db.MyTable
where lines.MyColumn == xxxx
select lines;
foreach (var line in res)
{
System.Diagnostics.Trace.WriteLine(line.yyyy);
}
return res;
}
Any ideas? I've been playing with Pooling=False and ConnectionHandle=<Connection I'm manually opening>, but I've had no luck as yet. I don't suppose any similar problems have been reported previously here?
I'm continuing to troubleshoot this problem. If I find any more clues I'll post them here too.