Check for Deadlocks and Timeouts
If there is no connect problem, a deadlock or timeout may be the problem. The SYS.SYSTEMSTATS
table and the SYS.MONITOR
table records information about deadlocks and timeouts. See Monitoring the TimesTen System Tables for information on how view the contents of this table. You can also use the ttXactAdmin
utility to detect the types of locks currently held by uncommitted transactions and the resources on which they are being held.
If a deadlock occurs, the TimesTen subdaemon negotiates the problem by having an application involved in the deadlock generate TimesTen error 6002, "Lock request denied because of deadlock.
" The error message contains the SQL that the lock holder is running, which can help you diagnose the cause of the deadlock. If your application encounters this error, it should roll back the transaction and then reissue the statements for that transaction. Deadlocks can be caused if your application issues statements in a particular order that results in a circular wait, and can sometimes be prevented by changing the order in which the statements are issued.
An application encounters TimesTen error 6003, "Lock request denied because of timeout
," if it cannot acquire a lock within the time period defined by the lock timeout interval set by the LockWait
attribute in the DSN or by the ttLockWait
procedure in your application. Upon encountering a timeout error, your application can reissue the statement. Keeping transactions short reduces the possibility of lock timeout errors.
In multithreaded applications, a thread that issues requests on different connection handles to the same database may encounter lock conflict with itself. TimesTen resolves these conflicts with lock timeouts.