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. Develop a connector for Data Loader
  6. Import a connector
  7. Connection attributes
  8. Type system
  9. Connector metadata
  10. Partitioning capability
  11. Pushdown capability
  12. Mappings in advanced mode
  13. Manual changes to Informatica Connector Toolkit source code
  14. Runtime behavior
  15. Connector example: MySQL_Cloud
  16. Version control integration
  17. Appendix A: Metadata models
  18. Appendix B: ASO model
  19. Appendix C: Connector project migration
  20. Appendix D: Frequently used generic APIs in Informatica Connector Toolkit
  21. 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); } */ }

0 COMMENTS

We’d like to hear from you!