Performance issue for 3rd party module

Friends,

I have created module using jar file and xml file. the jar file contains java methods which gets and manipulate data using db connection. when i run the methods in ignition from module it taking lot time(nearly 20-25 seconds) to execute the result. please help me in this scenario.

mreddy,
OpteBiz Pvt Ltd.

First, take all of your code and run it through a source code reverser. This will make all your logic operate in reverse. Then configure your code to output its debug routines into a VFD. The VFD should finally put your data into a text file, and from there your code will run really, really fast.

But in all seriousness, how do you expect us to help you with this post. If your code is taking a long time to run, its probably the logic inside your module. Post some code, let us know what the expected performance is, what are you comparing this to to determine that the module made your code slow, etc. Basic troubleshooting skills and the ability to formulate a proper request for help will go a long way.

Had me going for a second… Good advice.

I was going to recommend a turbo encabulator

Here I am pasting some code using for db connection in java.

[code]@SuppressWarnings({“CallToThreadDumpStack”, “null”, “ConstantConditions”, “UnusedAssignment”})
public static void getBonecpDBConnectionForInsert(String strQuery){

    //  Define required variables.
    BoneCP  connectionPool  =   null;
    BoneCPConfig config  =   null;
    Connection  connection  =   null;
    Statement stmt  =   null;
    
    //  Check for JDBC Driver class.
    try {
        // load the database driver (make sure this is in your classpath!)
        Class.forName("com.mysql.jdbc.Driver");
    } 
    catch (Exception e) {
        e.printStackTrace();
    }

    try {
        //   Setup the connection pool.
        config = new BoneCPConfig();
        config.setJdbcUrl(strJdbcUrl); // jdbc url specific to your database, eg jdbc:mysql://127.0.0.1/yourdb
        config.setUsername(strUserName);
        config.setPassword(strPassword);
        config.setMinConnectionsPerPartition(5);
        config.setMaxConnectionsPerPartition(10);
        config.setPartitionCount(1);
        connectionPool = new BoneCP(config); // setup the connection pool
        connection = connectionPool.getConnection(); // fetch a connection
       
        if (connection != null){
            stmt = connection.createStatement();
            stmt.executeUpdate(strQuery); // use the query to update the data]
        }
        connectionPool.shutdown(); // shutdown connection pool.
    } catch (SQLException e) {
        e.printStackTrace();
    } finally {
       connectionPool.shutdown();
        config   =   null;
        stmt    =   null;
         if (connection != null) {
            try {
                connection.close();
            }   catch (SQLException e) {
               e.printStackTrace();
            }
        }
    }
   
}[/code]

Is there a reason why you are trying to roll your own connection pool, as opposed to using the one Ignition has built in, which is accessible via context.getDatasourceManager?

Also, create connections in this manner is very expensive. Even rolling your own persistence connection pool would be better. However, using the one built into Ignition would be best.