Long lived TContext connection


we have a java service that makes a call to WM to execute a service, and we use TAM for authorization. The TAM times out connection after 5 minutes.

We are using TContext to generate the context, and set up with TTL of 3 hours. But, the TContext times out after about 11 minutes. Is there some way we can make TContext live longer?

What is the session timeout setting on IS?

The session timeout is 10 minutes. We poll for the status every 5 seconds, so the session should “theoretically” be active?

The timing sounds like the session is being timed out. What do you mean by “poll for the status” exactly?

Raemon, thank you for the reply. We use TContext to make the connection, and getTxStatusVal(tid) to read the status of the porcess (we have some porcesses that run for almost 1.5 hours).

When the connection is terminated, we get a status of failed.

I’ve never used TContext so I’m not entirely sure, but it seems from the behavior and the description of the method that getTxStatusVal doesn’t interact with the server. It is simply returning the status of the waiting job in the job manager.

My guess is that the session timeout is enforced regardless of the TContext settings, which appear to be more for controlling things on the client side than on the server side.

Implied in the docs is that you can start multiple transactions via startTx. Then you can call wm.server:ping to keep the session fresh. Something like this (omitting try/catch blocks that would be needed):

String tid1 = tc.startTx(180); // 3 hr TTL
tc.submitTx(tid1, “your.folder”, “yourservice”, new Values());
while(tc.getTxStatusVal(tid1) == TXJob.PENDING) // or other appropriate test
// keep the IS session alive
String tid2 = tc.startTx(1); // 1 minute TTL
Values out = tc.invokeTx(tid2, “wm.server”, “ping”, new Values());
Thread.sleep(5000); // wait 5 seconds
Values out = tc.retrieveTx(tid1);

Another way would be to simply increase the session timeout on the server, but a 3 hr session timeout may introduce other issues for the environment.

Thank you. I will try out the ping and keep you posted via this board. It may be a while before we try out all permutations and combinations.