database performance - SQL Server Compact 4 Startup - LoadNativeBinaries Slow -
we trying switch application serializes data files use database. basic windows form application.
i noticed on start-up of our application there significant lag when initializing database connection through entity framework. have no idea causing , google skills failing me.
i did dottrace performance profile on , showed:
the performance profile shows 14 seconds of sql server ce running loadnativebinaries
. missing? how speed up?
update
i created test database project , deployed device testing on. first time ran test program, took 17 seconds. after first time, took less second. tried running actual application , lag has disappeared. reinstalled application, , first time ran application, took 17 seconds, subsequent runs took less second. different original issue took 10+ seconds every launch.
i've uploaded test project using here. i'm curious if else gets similar results.
the following config file using
<?xml version="1.0" encoding="utf-8" ?> <configuration> <connectionstrings> <add name="dataentities" connectionstring="metadata=res://*/data.csdl|res://*/data.ssdl|res://*/data.msl;provider=system.data.sqlserverce.4.0;provider connection string='data source="data.sdf"'" providername="system.data.entityclient" /> </connectionstrings> <system.data> <dbproviderfactories> <remove invariant="system.data.sqlserverce.4.0"/> <add name="microsoft sql server compact data provider 4.0" invariant="system.data.sqlserverce.4.0" description=".net framework data provider microsoft sql server compact" type="system.data.sqlserverce.sqlceproviderfactory, system.data.sqlserverce, version=4.0.0.1, culture=neutral, publickeytoken=89845dcd8080cc91" /> </dbproviderfactories> </system.data> </configuration>
and test program:
using system.data; using system.data.entity; using system.data.sqlserverce; using system.data.entityclient; namespace databasetest { public partial class form1 : form { public string _connectionstring; public form1() { initializecomponent(); configuration execonfig = configurationmanager.openexeconfiguration("databasetest.exe"); _connectionstring = execonfig.connectionstrings.connectionstrings["dataentities"].connectionstring; } private void button1_click(object sender, eventargs e) { stopwatch st = new stopwatch(); st.start(); entityconnection ec = new entityconnection(_connectionstring); dataentities ent = new dataentities(ec); st.stop(); connectiontime.text = st.elapsed.tostring(); } } }
what os platform in use (os , service pack)?
this caused either 1 ) invalid access control list in rsa certificate folder or 2 ) invalid internet proxy configuration.
1) can fixed resetting acl (it broken administrators)
to reset files permissions, type:
icacls * /t /q /c /reset
2) can fixed correcting proxy configuration, or disabling certificate revocation lists checks via registry key.
to disable crl checking, create registry setting @ following location: hkey_local_machine\system\currentcontrolset\services\sstpsvc\parameters setting must dword value named nocertrevocationcheck. set value 1.
Comments
Post a Comment