Although the Entity Framework offers powerful productivity gains, some developers believe that the Entity Framework takes too much control of the features they need to optimize performance in their applications.
ADO.NET has a well-established set of relatively simple methods that can be used to enable and manage features such as connection statistics and reauthentication. DataDirect ADO.NET Entity Framework data providers include additional enhancements that can be used to enable, retrieve and reset statistical counters on a connection. Developers can use these enhancements to determine and then ultimately improve the application’s runtime performance.
This functionality is modeled in the xml file provided in Appendix A “Using an .edmx File”. By surfacing the DDTekConnectionStatistics and DDTekStatus entities, you can quickly model this code using the standard tooling.
To obtain connection statistics, first, establish an Entity Container, DDTekConnectionContext, in which two Entity Sets, DDTekConnectionStatistics and DDTekStatus, are defined. Then, to interact with each Entity, include functions to retrieve results.
Typically, you can configure a connection pool to provide scalability for connections. In addition, to help minimize the number of connections required in a connection pool, you can switch the user associated with a connection to another user, a process known as reauthentication. For example, suppose you are using Kerberos authentication to authenticate users using their operating system user name and password.
To reduce the number of connections that must be created and managed, you may want to switch the user associated with a connection to multiple users using reauthentication. For example, suppose your connection pool contains a connection, Conn, which was established using the user ALLUSERS. You can have that connection service multiple users, User A, B, C, and so on, by switching the user associated with the connection Conn to User A, B, C, and so on.
This functionality is modeled in the xml file provided in Appendix A “Using an .edmx File”. By surfacing the DDTekConnectionStatistics and DDTekStatus entities, you can quickly model this code using the standard tooling.
First, we establish an Entity Container, DDTekConnectionContext, in which we have two Entity Sets: DDTekConnectionStatistics and DDTekStatus. To interact with each Entity, include functions to retrieve results.
where DDTekConnectionContext is declared in the app.config file.