CICS

CICS

CICS

The world's leading application server software for IBM Z

 View Only
  • 1.  Multiple DataSources in Liberty

    Posted Fri March 28, 2025 05:16 AM

    We are currently using multiple dataSources with a JDBC-driver type4 in Liberty with CICS 5.6 and it works well. We now wanted to try the JDBC-driver type2 to compare the performance but we get an error message com.ibm.db2.jcc.t2zos.T2zosConnection.initialize: Multiple Connections are disallowed in current pre-existing attachment environment ERRORCODE=-4228, SQLSTATE=null

    All dataSource belong to the same DB2 , but have different Schemas. Does anyone use this type of configuration?



    ------------------------------
    Helmut Roese
    ------------------------------


  • 2.  RE: Multiple DataSources in Liberty

    Posted 30 days ago

    After we opened a case at IBM we got the answer that this type of processing does not work.

    There might be an option to circumvent the problem but this is not recommended.



    ------------------------------
    Helmut Roese
    ------------------------------



  • 3.  RE: Multiple DataSources in Liberty

    Posted 29 days ago

    Hallo Helmut!

    Did IBM mention a reason as to WHY it does not work? Using different dataSources within the same server configuration does not seem to be that far fetched an idea...

    Also, did you come to any conclusion regarding the performance comparison of JDBC type 2 and type 4? There seems to be an ongoing discussion and I feel like recommendations an swung back forth between the two options in recent years.

    Kind regards!



    ------------------------------
    Christoph
    ------------------------------



  • 4.  RE: Multiple DataSources in Liberty

    Posted 29 days ago

    Hi Christoph,

    the following answer came from IBM:

    "If you want to use Type 2 connectivity, the application should be changed to use only one connection. Using multiConnsWithExistingAttach (JCC property) is not recommended because it may cause problems due to connection sharing.

    T4 connection is based on DRDA, thats nothing to do with the existing attachemnet. t2 z/Os uses the existing attachment and it cannot work same as t4

    Usually we wont recommend to use this property"

    And regarding the performance perspective I recommend to have a look at the IBM Redbook from the IBM CICS Performance Series: IBM CICS Performance Series: Comparing Type 2 and Type 4 JDBC Driver Performance with IBM CICS Transaction Server for z/OS V5.2 Liberty JVM server

    We are not able to verify because of the above mentioned problem, but I guess it still works the same with CICS V6.x



    ------------------------------
    Helmut Roese
    ------------------------------



  • 5.  RE: Multiple DataSources in Liberty

    Posted 26 days ago

    One piece of information that may help explain the Type-2 restriction. CICS has a unique relationship with Db2 for z/OS. The connection to Db2 is between the CICS application server (aka, the CICS region or address space) and Db2. And CICS itself supports a connection to a single Db2 subsystem on the same z/OS LPAR -- there's no provision for connecting to a remote database. CICS applications coded in COBOL, C, etc. use this connection and therefore are only able to access one local Db2 subsystem. If data from a different Db2 subsystem or a remote Db2 is required, then a Db2-to-Db2 connection can be configured to allow access to the unique database being managed by the "other" Db2 system.

    When implementing support for Java applications and the JVMSERVER resource, the type-2 JDBC driver uses the CICS-to-Db2 connection rather than creating a connection between the application and the database server. That explains why your application cannot create a connection to a second Db2 when using the type-2 JDBC driver.



    ------------------------------
    Leigh Compton
    Consulting IT Specialist - CICS and Enterprise Integration
    IBM
    ------------------------------



  • 6.  RE: Multiple DataSources in Liberty

    Posted 23 days ago

    Hi Leigh,

    it is clear to me that CICS supports only one connection to one DB2. And our case is that all dataSource-definitions relate to the same DB2, but different with schemas. So the idea was that it might work because it does not violate the restriction. But it doesn't....

    But thank you for your explanation



    ------------------------------
    Helmut Roese
    ------------------------------