IBM Support

Maximo -- How to detect database connection leak?

Technical Blog Post


Maximo -- How to detect database connection leak?


Maximo uses its own internal database connection pool mechanism and does not use the application server database connection pool. In Maximo and Maximo based products such as Smart Cloud Control Desk, there can be database connection leaks. These database connection leaks could be caused by incorrect code as well as memory leaks.  In situations where there are database connection leaks, it is very difficult to identify the code where the connection leak is occurring.

The Maximo dbconnection watchdog logger can be used to find the database connection leaks.  Turn Maximo dbconnection watchdog logger to INFO. Collect Maximo logs for a 24 hour period.

If Maximo logs indicate lost connection and connection pool's used connections growing, it indicates a database connection leak.


[INFO] BMXAA7084I - The DbConnectionWatchDog class has been trying to close the database connection for: 230233001 ms

DbConnectionWatchDog:Db Connection reference id=436107 SPID=397
Create time:1302986384636
Life time:230233001 ms

In this example, the database connection watchdog logger is indicating the connection as being held for 230233001 ms i.e. approximately 64 hours. This database connection used by some Maximo transaction is not released back to the connection pool. This connection is considered a lost database connection as it is held for a long time and is not available for freeing to the free connection pool for reuse. By looking in the logs at approximately 64 hours back, one should be able to find the stack trace of where this connection was established. An example is

[INFO] BMXAA7084I - The DbConnectionWatchDog class has been trying to close the database connection for: 73000 ms
DbConnectionWatchDog:Db Connection reference id=436107 SPID=397
Create time:1302986384636
Create stack trace:
psdi.mbo.MboSet.isEmpty( Source)


With the dbconnection watchdog logger, the log files show exceptions as above and these indicate where the first occurrence of database connection access in the code. This exception indicates the code area where the connection leak is. If these connection leaks are in core product, the information can be provided to your product support team to get a fix. If the connection leak is in a custom code area, it should be addressed by your custom code development team.


The log file also indicates total number of connections used by the application server as follows.  This data is for the application server and not for the entire Maximo system.

[INFO] BMXAA7088I - The DbConnectionWatchDog class recorded 44 connection references in this period, currently there are 44 open references, 43 long running references, 43 long running connections, and 0 references that were closed by the garbage collector finalizer.
[INFO] DBManager Total number of connections: 49 Number of free connections = 5 Number of used connections = 44

The corresponding user count for the server shows as follows:

[INFO] BMXAA6369I - Server host: A.B.C.D. Server name: MXServer. Number of users: 13. WebClientSessions: (13)

In this situation, for 13 users, there are 43 long running connection.  If the long running references are significantly higher than the number of users (2 to 3 times) and constantly growing it indicates a database connection leak.


[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]