We run our application on Websphere 5.1 and are getting heapdumps.  I
was going through the IBM HeapAnalyzer to pin point possible memory leak
suspects.  One of the suspects is the HashMaps created from
iBatis(2.1.5) when we load up all our sqlMap xml files.  This made me
wonder whether we are doing things correctly.  When we start our
application we load all the iBatis files in:

 

if (singleton == null) {

 

            String resource =
"com/advtechgrp/bop/medical/data/sqlmaps-config.xml";

            Reader reader = Resources.getResourceAsReader(resource);

            singleton = SqlMapClientBuilder.buildSqlMapClient(reader);

 

        }

 

        if (nestedTransactionSingleton == null) {

 

            String resource =
"com/advtechgrp/bop/medical/data/sqlmaps-config.xml";

            Reader reader = Resources.getResourceAsReader(resource);

            nestedTransactionSingleton = SqlMapClientBuilder

                    .buildSqlMapClient(reader);

 

        }

 

        if (reportingClientSingleton == null) {

 

            String resource =
"com/advtechgrp/bop/medical/reports/data/reports-sqlmaps-config.xml";

            Reader reader = Resources.getResourceAsReader(resource);

            reportingClientSingleton = SqlMapClientBuilder

                    .buildSqlMapClient(reader);

 

        }

 

If this seems wrong let me know.  

Thanks,

Tom

 

 

Reply via email to