I’m developing n-layer architecture, and for the data access layer I am using Entity Framework 4.1.
The database oonly expose stored procedures. I also have an additional layer, service layer, developed in WCF.
For each service call, use a new data context in a using statement.
Considering that service calls will reach 1000 per second, this approach is right?
Best Regards.
1000 per second – if your service really has to do something you will need either very good server or load balanced environment.
If your database exposes only stored procedures and you cannot execute direct SQL (= you cannot use LINQ) there is no reason to use EF. Actually there are many reason why you should not because it will not give you any additional value except much worse performance. Also if your stored procedures use for example multiple result sets, table value parameters and some other advanced techniques you will not be able to use them from EF 4.1 at all.
Using direct ADO.NET will allow you executing queries asynchronously which can lead to asynchronous WCF service operations = better utilization of your computing power and better throughput.