This is a bit strange so bear with me please.

After installing a new SQL Server 2008 R2 on a new server (Windows 2012 Standard) just like the production one, I tried to connect my web aplication (Java/JDBC 4.0 Driver) the same way I always do with the production server but this time my application was frozen for at least 15 minutes!

At the moment I thought: "Maybe it's something to do with privileges" but I was wrong because that user is the db_owner and has all the privileges on that database. So I decided to use the SQL Server Profiler to list all the queries arriving and executing when I login on the application. The usual "select" here and there but then I noticed there was no "update" query trying to set the LastTimeLogin, and at the same time my web application stopped working. I let the time pass so I can see what else was happening on the database. And guess what? Nothing happend for 15 minutes (aprox) :(

After that an exception occurred:

Exception: Error saving LastLoginTime for account: demo org.package.db.DBException: Update record 'demo' [com.microsoft.sqlserver.jdbc.SQLServerException: connection timeout]

Then I went back to the web browser and everything was working normally. The application could "insert", "update", "delete", "select".

I have to mention, locally the SQL Server works perfectly with Management Studio and remotely via TSQL (linux console client). The firewall is open for any SQL Server request.

I hope someone can help me.

  • Sounds like it could be a blocking issue - run sp_who2 in Management Studio while your web server query is waiting and check the "blocked by" column. Commented Sep 19, 2014 at 6:06
  • I just did it and it shows a dot "." not a SPID. Commented Sep 19, 2014 at 6:57
  • I am not sure but please make sure 'Auto close' option is set false for the database
    – Shanky
    Commented Sep 19, 2014 at 8:33
  • I checked that too and it is set to FALSE. Commented Sep 19, 2014 at 23:11


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.