September 3, 2012

MBO Performance Tip N.8 - If there is no other way... use JDBC

This entry is part of the Java MBO performance optimization golden rules series.

Sometimes you have to perform some complex logic or you have to join several tables to retrieve a piece of data. In other cases there is a piece of code where performance is critical. In such cases it may be hard to achieve good performances accessing and fetching large MBO sets. Now it may be better to directly access the Maximo database to issue a well-tuned SQL query.

The DBShortcut or DBManager() classes allow to directly access the database. Look at this post that describes the different techniques to retrieve a JDBC connection to the Maximo database.

When using this technique be aware of any security or other business logic that you may be bypassing by not using MBOs. Ensure that you are not bypassing any important logic, such as security logic which restricts users from seeing certain sets of data.

I strongly suggest to use this technique only when data reading data. When modifying and saving data, it is better to use the MBOs to leverage security and validation checks provided by business objects.

No comments:

Post a Comment