Should i use Pooling=False in Entity Framework Connection String? - asp.net-mvc-3

We have an ASP.Net MVC3 application that is running on Azure, connecting to a Sql Azure Database via Entity Framework.
The Developer that produced this has Pooling=False in the connection string. I would have thought this was a bad idea - wouldn't we want to re-use the connections if possible?
Can anyone give me some guidance of when this might be a good idea?
Thanks!

Yes, it is bad idea to have pooling=False. I don't use this option even for development. You should always use the SQL Server Connection Pooling.
What you have to be aware of, however is the Transient Errors in SQL Azure. There are a couple of good reading that can be found on the Internet on how to handle Transient Errors in SQL using Entity Framework. Here is a (non-complete) list of some:
Best practices for handling Transient conditions in SQL Azure
SQL Azure and EF fault handling
EF CodeFirst and Transient Errors
Handling Transient Errors in SQL Azure
Always use connection pooling, but be aware of the Transient conditions in SQL Azure.

Related

oracle CRUD frontend

We have an existing system using Oracle DB and several applications working on/off it using JDBC/ODBC etc. For an additional interface for CRUD operations I am looking at a web based front-end. I dont see a whole of ideas in this areas, maybe because the ORacle DB is mostly enterprise and probably means the enterprises building their own custom apps?
Using the Oracle REST API services, build a front end using Angular/JS. This eliminates any need for oracle specific server side logic and almost ORacle independent. Are there any frameworks / opensource tools that fall in this area?
Please let me know any comments / feedback on this approach.
As far as I know there aren't really any options like this specifically for Oracle databases. You might be better off going with a desktop solution, of which there are many.
There is a web UI called "H2 Console" which claims to work with any JDBC connection. I have used this with MySql before with great success but have not tried it with Oracle.
The H2 Console application lets you access a database using a browser. This can be a H2 database, or another database that supports the JDBC API.
If you want something more 'user friendly' then as far as I know there are no existing solutions for this. You will probably have to build your own or educate your users on SQL.

Object persistence without ORM or DB Engine

I learned to love how LINQ enables set operations on collections. I'm not saying that I plan to shun traditional RDMBS, because I do need it for reporting. There are NoSQL alternatives out there, but they seem to all need to fire up a separate service.
What I looking for is something local where a DLL can create a database and perform CRUD on it. As mentioned, I'm not going to report out of this, just internal data store. The main application that will be using it is in C#.
I'm hoping that someone can give me a lead. If not, if there is anyone willing, we can start a open-source project for it. I'm not interested in commercial products.
Thanks,
You can run RavenDB in embedded mode inside your .NET application - no need for external services or anything.
And RavenDB supports Linq....

Logging errors with Elmah and nHibernate

I'm working on an Asp.Net MVC3 application and we are looking at using Elmah to do our data logging. We are using fluent nHibernate to handle all interaction with mainframe DB2 database. So any other DB provider, is not an option.
I've been doing some research on this topic and cannot find any information on how to do it. Would rewriting one of Elmah DB providers to handle interfacing be appropriate?
I'm looking for some guidance on how to start this or where to look for the guidance.
I agree with the commenters on your question. Use log4net instead of ELMAH if at all possible. NHibernate requires log4net, so it will already be present. In addition to error logging, you can log copious NHibernate stuff (in particular the SQL statements it generates), which I find very useful while building and debugging an application.
With log4net you can send log messages to an Oracle database with the AdoNetAppender.
From my understaning Elmah is implemented as a HTTP Module, and does not use a NH so you would have to write a provider (inherit from ErrorLog), look at the Oracle implemation then change the webconfig to point to your class
there is a issue open on the google project site, I would see if you can vote on this, as it would be less work for you, but you may have to wait longer
http://code.google.com/p/elmah/issues/detail?id=257

Entity Framework With Sql Azure over net tcp slow performance

Hy guys,
So i have a really big performance issue here. I have a WPF application which connects to a service which runs inside a Worker Role. The service uses net tcp binding with full duplex. The data access layer is all in a library which i am referencing in my service. So when my service want's to get data it uses the methods in that library. That library uses EF 4.1 which is mapped to an Sql Azure database.
The problem i am facing is that a query like getting a user from a database, takes somewhere above 4 seconds. I have also a http service(used by a Silverlight app) which uses the same dataaccess library, the same query over there takes 115ms, which is normal.
Is there a problem with the Entity Framework when i am using a net tcp service? I really don't know where the issue is, because over a http service all the queries behave normaly.
Is it possible you are using Lazy Loading instead of Eager loading with your entity? Lazy Loading over the Internet is much slower since it results in many more roundtrips to SQL Azure, which would be the bottle neck in this case. Eager Loading will simply get all of the data at once with a single round trip.
Reference: http://msdn.microsoft.com/en-us/library/bb896272.aspx

Is it possible to use LINQ to SQL with Oracle?

I need to develop a program that must delete and insert data into an Oracle database. Is it possible to use LINQ to SQL with Oracle?
For development I use MS SQL server but it will be a Oracle database in production. What do you recommend?
Officially No. Linq to SQL was originally build with the ability to swap out the data provider to allow connections to other databases, but they disabled this functionality in the released versions to encourage people to use more stable and supported data access layers (like EF). The recommended approach is to use Entity Framework if you want to switch between SQL and Oracle.
Also, Patrick is very right, make sure you are developing and testing against the same database platform you are going to use in production, there is a world of difference in how they operate. Sure, you should be able to abstract it away to not care about whether you are using SQL or Oracle, but that is almost never really the case.
No, you can't. Although LINQ to SQL was initialy designed with multi-database support in mind (you can see this when looking at the code using .NET Reflector) using a provider model, this model was never made public and Microsoft has no intensions in adding multi-database support to LINQ to SQL.
If you need multi-database support, please use Entity Framework.
No, LINQ-to-SQL doesn't support Oracle. Internally, the project had support for multiple back-ends, but this never made it into the final public release. I believe LINQ-to-Entities supports other databases.

Resources