MeuEntities
is a class generated by the Entity Framework , inheriting from DbContext, right?
Connection life cycle
Using the Entity Framework , you do not control the life cycle of the connection, but rather the context life cycle. At specific times the context will require a connection with the bank to seek or persist entities.
The physical connection to the database is managed by ADO.Net , which maintains a pool of connections to avoid creating a new connection every time the consumer needs one, offers better performance as creating a connection to the database has a high cost.
Keep context life short and leave the connection management with the Entity Framework and ADO.Net that it uses underneath.
And this you are already doing since you create the context just to persist and you undo it.
The relation between the class being static and the life cycle of the connection.
There is no relationship. The scope of the context or fact that you undo it (either by invoking the dispose method or by instantiating it with using ) is going to affect the connection life cycle. The fact that the context-consuming class is static has no relation.
Now, if you declare the context in a static variable and never get rid of it, then you can negatively affect the connection lifecycle.
Finally
Remove the call to the dispose method from your code as using method serves to secure this call.