How to detect and resolve database connection leak?

There are 2 very detailed posts on IBM DeveloperWorks written by Manjunath about database connection leaks – how to detect them and how to resolve them.

Maximo — How to detect database connection leak
Maximo — How to solve database connection leak

Here is the crux –

To free up locked database connect in maximo, IBM has introduce 3 new system properties (7.5.0.3 onwards) –

mxe.db.closelongrunconn – default is false.

mxe.db.longruntimelimit – default 180 minutes.

mxe.db.detectlongrunconninterval – default is 30 minutes. This is the frequency in which the long running connections are checked. Cannot be less then 30 minutes.

The mxe.db.closelongrunconn property when set to true will close the lost connections if the connections have been held for greater than mxe.db.longruntimelimit time and were not used by any processes in that time duration.


To detect database connection leak, turn Maximo dbconnection watchdog logger to INFO and collect the logs for 1-2 days. If there are any connection leaks the logs will show some thing like this –

[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

The Logger indicates that the connection as being held for 230233001 ms i.e. approximately 64 hours. 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

Maximo Fix Delivery – What’s Changing?

IBM has done some changes to the way it delivers fixes for Maximo. Here are the main points –

  1. LA Fix report available in Maximo – obtain the list by running LATestFixReportWriter.bat program from the <maximo>\tools\maximo directory, available in 7.5.0.2 and above
  2. Cumulative interim fixes (IFIXES) are now delivered every 4 weeks
  3. Fixpack delivery schedule changed from 6-8 months to every 3-4 months (quarterly)
  4. Fixpack vs Featurepack – Fixpack now called “feature packs” which will be a combination of bug fixes and product features & enhancements

Here is the link to the complete article –

DeveloperWorks – Maximo Fix Delivery

Disabling The Warning Message Shown While Closing The Browser

Sometimes when I am in a hurry and I have to close my browser which has multiple Maximo sessions open, it is very frustrating to see each tab asking me to click on ‘Leave This Page’ to close it even after signing out from one of the tabs.

Close Confirmation

There is a property in Maximo – webclient.exitwarn to disable this. By default its set to 1. Setting it to 0 from the system property application will disable the confirmation box. This doesn’t require a restart to take effect as this property is Live Refresh enabled.

Printing Class Details When Debugging in Maximo

Sometimes when I am asked to look into some issue or I have to debug some out of the box functionality in Maximo, I start wondering where to start.

Logs are one good place to start debugging. Turning the logger level of appropriate loggers to debug prints lots of information in the system out (which can be a performance overhead also so be cautious).

To print more specific details of the class that is writing these logs there is a tweak that can be done in the logging application.

In the logging application, in the Manage Appenders dialog in the select action, select the console appender. In the table details, update the Conversion Pattern to

–CLASS -> %C LINE -> %L %d{dd MMM yyyy HH:mm:ss:SSS} [%-2p] [%s] [%q] %m%n

Logger - Manager Appender

This will print the classname and the line number for all the log entries made in the systemOut.log and maximo.log, which will look something like this –

Logger - SystemOutLog

This can be the starting point for your debugging. If you created custom appenders, this tweak can be implemented on the custom appenders leaving the console appender as it is.

isNew() vs toBeAdded() Methods in MBO

Often this question is asked that what is the difference between isNew() and toBeAdded() methods of the Mbo. Before I explain the difference let me tell you what these methods are –

  • isNew() – Returns whether the mbo is new or not. true, if the mbo is new (i.e. created by calling add() or insert() methods), otherwise false.
  • toBeAdded() – Returns whether the Mbo is to be added to storage
  • toBeDeleted() – Returns whether the Mbo is to be deleted from storage
  • toBeSaved() – Returns whether the object need to be saved to persistent storage. This will also check child objects.

All these method are in the psdi.mbo.Mbo class and have a return type as Boolean.

The difference is explained using the scenarios in the below table

Scenario isNew()  toBeAdded() toBeDeleted() toBeSaved()
New Mbo Added True True False True
New Mbo Added, deleted before saving the Mbo True False True False
Existing Mbo updated False False False True
Existing Mbo deleted False False True False

All about Count Method

Although it is discouraged to use the count method of mboSet as it hits the database to get the count but at times it can be very useful. There is an overloaded method count(int countConstant) that can be used to get the count of mbos that are in different state in the mboset.

Here is the explanation of the parameter –

countConstant – one of the constants from psdi.mbo.MboConstants. The list below shows each constant and describes the count returned for each.

  • COUNT_DATABASE — The count from the database.
  • COUNT_ADDITIONS — The count of newly added Mbos that have not yet been saved.
  • COUNT_DELETED — The count of Mbos marked for deletion that have not yet been saved.
  • COUNT_EXISTING — The sum of the count from the database (COUNT_DATABASE) plus newly added Mbos that have not yet been saved (COUNT_ADDITIONS).
  • COUNT_AFTERSAVE — The number of Mbos that is anticipated to be in this MboSet after saving. Equals the sum of the count from the database (COUNT_DATABASE) plus newly added Mbos that have not yet been saved (COUNT_ADDITIONS) minus Mbos marked for deletion that have not yet been saved (COUNT_DELETED).

The count() method without the parameter is Same as count(COUNT_EXISTING).

Lookup With WhereClause

Did you know that you can create lookups in Maximo (in the lookups.xml) with whereclause and attach it to an attribute in application designer. The attribute doesn’t require a domain to be attached to it to show the data in the lookup .

Lookup_WhereClause

The lookup will simply query the object mentioned in the mboname with the whereclause and display the result. The only drawback to this approach is that there is no validation on the attribute – any value entered in the field would be accepted without any validation.

The where clause also accepts run-time variables such as :user.

This is useful in places such as report request pages where a parameter needs to be passed to the report with a lookup which shows much filtered data then is usually shown in the lookup in the application.

For instance this asset availability report request page has a parameter as Tool which only shows items of type tool and not all the items.

ReportRequestPage_ToolLookup

Configuring Download Limit in Maximo

Did you know that there is a property in Maximo to limits the number of records downloaded from the list tab, dialogs and tables. The webclient.maxdownloadrows in system properties can be used to achieve this. The default value for this property is set to -1.

webclient.maxdownloadrows

A setting of -1 will result in unlimited download records from the List tab, however it will result in any download from a lookup dialog to default to the out of the box limit of 200 rows.

Note that the same limit of 200 rows will apply to the tables in the application (table like Subassemblies table in the Spare Parts tab of the Asset application)

A setting higher than 200, for example 500, will result in the limit being set at all the places – list tab, dialogs and tables.

This property is Live Refresh enabled so it doesn’t require a server restart to take effect.

Caution – Setting the limit to too high a value may result in performance issues and sometimes the JVM may go out of memory specially if the table being downloaded has lots of related columns (columns shown using relationship).

Maximo 7.6 Resources and Known Bugs

Maximo 7.6 was released last year with a ton of new features to explore. A lot of organizations are upgrading their existing Maximo implementation to 7.6 to benefit from these features.

Here are some of the resources that would help you know more about these features and about installing and upgrading to Maximo 7.6.

IBM Maximo Asset Management Wiki
Information regarding Maximo 7.6 features, installation, upgrade
Installing Maximo 7.6: A first look, part 1
Installing Maximo 7.6: A first look, part 2
Installing Maximo 7.6: A first look, part 3
Installing Maximo 7.6: A first look, part 4

Known bugs while installing Maximo 7.6:
1. While installing Maximo on windows server 2012, if the directory in which the installables are extracted has a space within the path, the installation fails.
2. After installation of maximo has completed the installValidation.bat throws NullPointer exception. PMR open with ibm.