When you start the RepAgent thread, the process terminates; you see this error message in the Adaptive Server error log:
95/09/22 08:51:43.34 RepAgent (10) Error: 9202, Severity: EX_User, State: 1 The Rep Agent Thread context for database ‘westDB’ has already been reserved by another session.
I. 95/09/22 08:51:43. Connection to SQL Server ‘westernDS’ succeeded. H. 95/09/22 08:51:43. THREAD FATAL ERROR #1078 logscan thread(westernDS.westDB) - /ltmscan.c(734) This client lib or server error is fatal. The server the thread connects to is ‘westernDS’. E. 95/09/22 08:51:43. ERROR #2028 logscan thread(westernDS.westDB) - /ltmscan.c(734) Message from server: Message: 9121, State: 2, Severity: 16 -- ‘The log transfer context for the current database is already reserved by SQL Server process 8. The log transfer context for the current database is not reserved.’.
Only one RepAgent thread can connect to a database at any one time. Because the RepAgent abnormally terminated, the RepAgent thread process still exists although it is in the sleep mode. The RepAgent thread wakes after the time specified in the scan_retry parameter elapses. Since the RepAgent has already terminated, the RepAgent thread process terminates when it wakes.
After shutting down a RepAgent thread, wait for two minutes or twice the value of the scan_retry parameter, before restarting it. The default for the scan_retry parameter is 60 seconds.
If the problem persists:
Log in to the Adaptive Server.
Terminate the process using the process ID number found in the error log. In this example, the process ID number is 8.
1> select spid, program_name, hostname from sysprocesses 2> where spid = 8 3> go
spid program_name hostname ------ ---------------- ---------- 8 repagent bsl0h.bsl (1 row affected)
1> kill 8 2> go
Run sp_who to check whether the process is terminated.
If the process still exists, recycle the Adaptive Server and the RepAgent thread.