Table of Contents

Search

  1. Preface
  2. Introduction to Informatica Connector Toolkit
  3. Before you begin
  4. Develop a connector for Cloud Data Integration
  5. Import a connector
  6. Connection attributes
  7. Type system
  8. Connector metadata
  9. Partitioning capability
  10. Manual changes to Informatica Connector Toolkit source code
  11. Runtime behavior
  12. Connector example: MySQL_Cloud
  13. Version control integration
  14. Appendix A: Metadata models
  15. Appendix B: ASO model
  16. Appendix C: Connector project migration
  17. Appendix D: Frequently used generic APIs in Informatica Connector Toolkit
  18. Appendix E: Frequently asked questions

Cloud Data Integration Connector Toolkit Developer Guide

Cloud Data Integration Connector Toolkit Developer Guide

Connection Pooling through API

Connection Pooling through API

To configure connection pooling through the API, after you make the code changes for connection pooling, override the getPoolingOptions() method in the MetadataAdapter class.
The method sets the following values of the connection pooling attributes:
@Override public void getPoolingOptions(ConnectionPoolingOptions options){ /** * The default values are: * maxTotal = -1 * maxTotalPerKey = -1 * maxIdlePerKey = 20 * MinEvictableIdleTimeMillis = 1200000 * MaxWaitMillis = 30000 */ /* boolean supportPooling = Boolean.FALSE; boolean supportPooling = (System.getProperty(Demo4Connection_CONNECTIONPOOLING_ENABLE) == null || System.getProperty(Demo4Connection_CONNECTIONPOOLING_ENABLE).isEmpty()) ? Boolean.FALSE : Boolean.parseBoolean(System.getProperty(Demo4Connection_CONNECTIONPOOLING_ENABLE)); int maxTotal = (System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXTOTAL) == null || System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXTOTAL).isEmpty()) ? 0 : Integer.parseInt(System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXTOTAL)); int maxIdlePerKey = (System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXIDLE_PERKEY) == null || System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXIDLE_PERKEY).isEmpty()) ? 0 : Integer.parseInt(System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXIDLE_PERKEY)); int maxTotalPerKey = (System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXTOTAL_PERKEY) == null || System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXTOTAL_PERKEY).isEmpty()) ? 0 : Integer.parseInt(System.getProperty(Demo4Connection_CONNECTIONPOOLING_MAXTOTAL_PERKEY)); long minEvictableIdleTime = (System.getProperty(Demo4Connection_CONNECTIONPOOLING_MINEVICTABLE_IDLETIME_MILLIS) == null || System.getProperty(Demo4Connection_CONNECTIONPOOLING_MINEVICTABLE_IDLETIME_MILLIS).isEmpty()) ? 0 : Long.parseLong(System.getProperty(Demo4Connection_CONNECTIONPOOLING_MINEVICTABLE_IDLETIME_MILLIS)); if (supportPooling) { options.setSupportPooling(Boolean.TRUE); options.setTestOnBorrow(Boolean.TRUE); //If value is set to zero then we will use default values if (maxTotal > 0) options.setMaxTotal(maxTotal); if (maxIdlePerKey > 0) options.setMaxIdlePerKey(maxIdlePerKey); if (maxTotalPerKey > 0) options.setMaxTotalPerKey(maxTotalPerKey); if (minEvictableIdleTime > 0) options.setMinEvictableIdleTimeMillis(minEvictableIdleTime); } else { options.setSupportPooling(false); } */ }

Back to Top

0 COMMENTS

We’d like to hear from you!