SQL Server connection is not disconnect


I have connect MB with SQL Server 2012 and could generate reports. Unfortunately connectivity with SQL server is not disconnect when we are not using it. This cause frees SQL processes. I tried with different servers and DBs. Is there any configuration that could time out or disconnect session in MB?

I think currently the only way to get around this is to kill the connection or restart Metabase.
Are you saying that Metabase is causing the database to hang?
You might want to look at the Metabase logs to see if there’s any warnings/errors.


When I kill the process, It will reconnect automatically. Yes this cause to hang the DB.

I don’t see that issue on SQL2008. Which version of Metabase? Did you check the logs for any errors - both Metabase and SQL?


SQL 2012 , Mb 0.31 , And cannot find exact log for related with Mb.
but SQL log says “marked for unload due to memory pressure.”

Let’s see if Andrew can assist - he knows a lot more about various SQL Server stuff than me.
Pinging @AndrewMBaines

MS SQL Server has no process to automatically timeout connections. People do run processes that stop unused processes, but they’re not recommended as they can cause other problems.

In general, the SQL processes don’t matter. If you’re SQL Server is so starved of memory for them to be a problem, then you’ll probably be having other issues too.
What’s the specification of your server?


Is there any mechanism that Mb has to disconnect server and connect server as it needs?
Server specification

No, you’d need to rewrite the driver. Assuming you don’t have a monster database on there, you shouldn’t be having any problems.
I run a tiny sample DB Server with just 2GB RAM. Metabase keeps its connection open but never causes a problem.
I think your issue is elsewhere, but my skills are in writing SQL etc rather than database configuration. Might be worth a try on a SQL Server forum.


Content of records in tables are high and connect with multiple tables. I took only 1000 records.

It shouldn’t matter. An idle connection is just that.
If what you’re saying is that the original query killed the database, then that’s a different problem all together.
It may only appear to be 1000 records, but it’s quite possible that SQL has had to scan the entire table to retrieve those 1000.

If that is the case, convert you question to SQL. Copy the SQL into SSMS and take a look at the query plan.


Those are optimized sql (views). When we run in Mb records (Questions) comes withing a few seconds. It is not an issue. Issue will come when it keep connection with SQL server and freeze the SQL process that call from other applications. When we stop the Mb, applications are working back.

Sorry, no idea. Sounds very odd. Is there a record lock or something? There’s no way that there should be a problem.
Is it just one view that causes the problem? What happens if you have a trivial question on just one small table (not a view)?