[en] Polling (heartbeat) vs KeepSessionAlive (solved)

Topics: Technical Support
Oct 24, 2013 at 6:39 AM
Edited Oct 24, 2013 at 7:13 AM
As I understand both these mechanisms update session timestamps. But for keepSessionAlive poll period is automatically taken from server. However polling provides more features on client (period, disconnected event, reconnection) and server (polling tracing). So is there a need of keepSessionAlive if we can use polling?
Coordinator
Oct 24, 2013 at 11:33 PM
That's a good question.

These features looks similar, but they are designed for different purposes.
  • KeepSessionAlive is used to prevent idle sessions from timing out.
  • Connection polling is used to detect and repair connection problems on the client-side, and it doesn't renew the current session.
  • They both use timers, but timing intervals are set up independently.
You're right, in most cases we could use connection polling to renew the current session. But as polling interval may differ from session lifetime, it wouldn't keep short-living sessions alive. Another point is that RenewSession may be relatively expensive operation (for persistent sessions, it's an UPDATE SQL statement). Connection polling can be set up to fire every few seconds, so it should be very cheap. That's why we don't merge KeepSessionAlive with connection polling.
Marked as answer by zii_dmg on 10/25/2013 at 3:29 AM