How to set XA transaction timeouts | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

How to set XA transaction timeouts

We use SQL Server 2000, and the Microsoft JDBC driver, service pack 3a. We use distributed transactions where queries to SQL Server are one of the branches. We want to make sure that none of the SQL Server operations run for more than 20 or 30 seconds. Is there a way to have the SQL Server operation timeout, and release all the locks it holds? In other words is there a way for the SQLServer operation to timeout and cleanly rollback? This event should return an exception to the JDBC driver, which will let the application roll back the whole distributed transaction. Any help is greatly appreciated. thanks, chalakanth
I think you are talking about QUERY_GOVERNOR_COST_LIMIT You can set it on server level:
See server property : server setting
I wouldn’t recoment it thought, as any query in server will be canceled it
it exeed specified limit.