My Oracle Support Banner

How To Enable SO_KEEPALIVE For The GlassFish Server ORB (Doc ID 1376545.1)

Last updated on FEBRUARY 03, 2023

Applies to:

Oracle GlassFish Server - Version 2.1.1 and later
Information in this document applies to any platform.


Consider a scenario where a typical application is serving a few hundred Thin Native Clients located at multiple sites of a corporate network as well as at external sites. The clients run on PCs; a running client on average has one open connection to a GlassFish's IOP-SSL port 37884, and 2 or 3 connections to the non-SSL IOP port 37886, sometimes more.

These IOP connections turn stale when a user simply switches off their PC or when a firewall has seen no traffic for a number of hours. In both cases, the GlassFish Server receives neither a TCP FIN nor a TCP Reset, so the connection stays open from GlassFish's point of view and indefinitely ties up a worker thread (if SSL) and an NIO Selector with its three associated auxiliary open file descriptors. Available worker threads would soon be exhausted, necessitating a GlassFish restart.

The GlassFish ORB needs a way to enable SO_KEEPALIVE, so that stale connections will be detected and closed after a few hours, and the associated resources freed.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.