java - Old Connection increasing TempDB size -


i have java application in connected mssql database query using java thread every 1 sec information, below pseudo

    new connection      query db if information looking               processes      else              sleep 1 sec      clean resources/connect resources free 

so happening is, sql server allotted spid 60 query , when java cleaned , closed connection , after 1 sec again asked connect execute same query sql server allotted spid 60

due tempdb file never free , keep increasing. question is: how ensure each time new session in sql server? tempdb not keep increasing , holding space.

problem connection pool settings , 1 java code keep pooling in 1 sec because of connection never closed. below settings jboss 5 , mssql server

<?xml version="1.0" encoding="utf-8"?>  <datasources>  <local-tx-datasource>   <jndi-name>base_nucleusdv</jndi-name>    <driver-class>com.microsoft.sqlserver.jdbc.sqlserverdriver</driver-class>    <connection-url>jdbc:sqlserver://db;databasename=reportservices;</connection-url>   <security-domain>encryptpassword</security-domain>     <!--pooling parameters-->     <min-pool-size>0</min-pool-size>     <max-pool-size>20</max-pool-size>     <idle-timeout-minutes>1</idle-timeout-minutes>     <query-timeout>60</query-timeout>     <track-statements>true</track-statements>   </local-tx-datasource>   </datasources> 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -