I work with VS.NET 2005 (c#), still use Vanatec.Open.Access version 4.3.21.866 and connect with SQLServer2000/2005 instances.
When I start my program from a deployment machine, the first connection when the first ObjectScope is created takes between 10 and 30 seconds whereas on my developermachine this is only an issue of milliseconds. Here is the beginning of the trace-files of both machines.
Developer machine:
--------------------------
14:15:54.068 pmf.start Log Level: all
14:15:54.271 driver.con.connect SSL=off;DOMAIN=;TDS=8.0;PACKETSIZE=0;NAMEDPIPE=false;SERVERTYPE=1;INSTANCE=;LOGFILE=;LANGUAGE=;MAXSTATEMENTS=500;SENDSTRINGPARAMETERSASUNICODE=true;APPNAME=jTDS;USER=sa;PREPARESQL=1;LOBBUFFER=32768;CHARSET=;TCPNODELAY=true;PROGNAME=jTDS;DATABASENAME=GreyhoundsDevCM;MACADDRESS=000000000000;PORTNUMBER=1433;XAEMULATION=true;LOGINTIMEOUT=0;SERVERNAME=192.168.10.53;LASTUPDATECOUNT=true;LOCK_TIMEOUT=5000;
14:15:54.271 driver.con.connect SSL=off;DOMAIN=;TDS=8.0;PACKETSIZE=0;NAMEDPIPE=false;SERVERTYPE=1;INSTANCE=;LOGFILE=;LANGUAGE=;MAXSTATEMENTS=500;SENDSTRINGPARAMETERSASUNICODE=true;APPNAME=jTDS;USER=sa;PREPARESQL=1;LOBBUFFER=32768;CHARSET=;TCPNODELAY=true;PROGNAME=jTDS;DATABASENAME=GreyhoundsDevCM;MACADDRESS=000000000000;PORTNUMBER=1433;XAEMULATION=true;LOGINTIMEOUT=0;SERVERNAME=192.168.10.53;LASTUPDATECOUNT=true;LOCK_TIMEOUT=5000;
14:15:54.334 driver.con.isolation READ_UNCOMMITTED(1)
14:15:54.334 driver.con.autoCommit false
...
Deployment machine:
----------------------------
14:23:44.720 pmf.start Log Level: all
14:23:44.798 driver.con.connect SSL=off;DOMAIN=;TDS=8.0;PACKETSIZE=0;NAMEDPIPE=false;SERVERTYPE=1;INSTANCE=;LOGFILE=;LANGUAGE=;MAXSTATEMENTS=500;SENDSTRINGPARAMETERSASUNICODE=true;APPNAME=jTDS;USER=sa;PREPARESQL=1;LOBBUFFER=32768;CHARSET=;TCPNODELAY=true;PROGNAME=jTDS;DATABASENAME=GreyhoundsDevCM;MACADDRESS=000000000000;PORTNUMBER=1433;XAEMULATION=true;LOGINTIMEOUT=0;SERVERNAME=192.168.10.53;LASTUPDATECOUNT=true;LOCK_TIMEOUT=5000;
14:23:49.298 driver.con.connect SSL=off;DOMAIN=;TDS=8.0;PACKETSIZE=0;NAMEDPIPE=false;SERVERTYPE=1;INSTANCE=;LOGFILE=;LANGUAGE=;MAXSTATEMENTS=500;SENDSTRINGPARAMETERSASUNICODE=true;APPNAME=jTDS;USER=sa;PREPARESQL=1;LOBBUFFER=32768;CHARSET=;TCPNODELAY=true;PROGNAME=jTDS;DATABASENAME=GreyhoundsDevCM;MACADDRESS=000000000000;PORTNUMBER=1433;XAEMULATION=true;LOGINTIMEOUT=0;SERVERNAME=192.168.10.53;LASTUPDATECOUNT=true;LOCK_TIMEOUT=5000;
14:23:53.798 driver.con.isolation READ_UNCOMMITTED(1)
14:23:53.798 driver.con.autoCommit false
....
---> so the 2 "driver.con.connect"-lines took close to 5seconds(!) here, but there there is no exception or something like that and the program works fine afterwards. ???
The configuration file is loaded dynamically:
-------------------------------------------------------
public
static IObjectScope GetNewObjectScope(string alternateUsername, string alternatePassword) {
string myconfig =
"<openaccess>" +
"<references>" +
// refer the DAL assembly with app.config with backendconfig section
"<reference assemblyname='Greyhounds_BusinessObjects' configrequired='TRUE'/>" +
"</references>" +
"<connections>" +
"<connection id=\"" + _DB_Servername + alternateUsername + "Con\">" +
"<databasename>" + _DB_Databasename + "</databasename>" +
"<servername>" + _DB_Servername + "</servername>" +
"<integratedSecurity>false</integratedSecurity>" +
"<backendconfigurationname>sqlConfiguration</backendconfigurationname>" +
"</connection>" +
"</connections>" +
"<backendconfigurations>" +
"<backendconfiguration id=\"sqlConfiguration\" backend=\"mssql\" driver=\"" + (GlobalData.SqlServer == SqlServerVersion.SqlServer2005 ? /*"genericADO2"*/"ntds" : "ntds") + "\">" +
"<mappingname>mssqlMapping</mappingname>" +
"<isolationLevel>READ_UNCOMMITTED</isolationLevel>" +
"<logging.logEvents>all</logging.logEvents>" +
"<logging.logEventsToTrace>True</logging.logEventsToTrace>" +
"<logDownloader.eventText>True</logDownloader.eventText>" +
"<option.Multithreaded>True</option.Multithreaded>" +
"<conTimeout>1200</conTimeout>" +
"<retryCount>3</retryCount>" +
"<retryIntervalMs>500</retryIntervalMs>" +
"<waitForConOnStartup>False</waitForConOnStartup>" +
"</backendconfiguration>" +
"</backendconfigurations>" +
"</openaccess>";
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(myconfig);
return OpenAccess.Database.Get(_DB_Servername + alternateUsername + "Con", xmlDoc.DocumentElement).GetObjectScope(alternateUsername, alternatePassword);
}
Hope you can help me to get rid of that serious start-up-problem!