With parameter CONNECT(AUTO) in SETUPxx this error is seen when executing some DDL using Batch Processor:
PTIDB2-CAF: ADDRESS SPACE CONNECTED WITH DIFFERENT NAME OR TYPE
BPA0010E: CONNECTION TO DB2 SSID ssid HAS FAILED USING PLAN: RBPAPLAN
With CONNECT(AUTO) in hlq.CDBAPARM(SETUPxx):
A split screen is being used in ISPF:
1) In the first screen an IBM Db2 Administration tool is opened
2) In second an ISQL session will execute some DDL with Batch Processsor
In the ISQL session this error is received when BATCH PROCESSOR is executing:
PTIDB2-CAF: ADDRESS SPACE CONNECTED WITH DIFFERENT NAME OR TYPE
BPA0010E: CONNECTION TO DB2 SSID ssid HAS FAILED USING PLAN: RBPAPLAN.
With CONNECT(CAF) in hlq.CDBAPARM(SETUPxx) the same error is not observed.
As the Db2 Admin Tool is using CAF and Batch Processor is using RRSAF, the problem of simultaneous accesses (CAF and RRSAF) is the reason for the PTIDB2-CAF message.
Regarding the split screen situation where two utilities are accessing DB2 the IBM documentation states:
Connecting to Db2 from your application program
Note the "Requirement" box.
"Different attachment facilities cannot be active concurrently within the same address space. Specifically, the following requirements exist:
An application must not use CAF or RRSAF in an CICS or IMS address space.
An application that runs in an address space that has a CAF connection to Db2 cannot connect to Db2 by using RRSAF.
An application that runs in an address space that has an RRSAF connection to Db2 cannot connect to Db2 by using CAF.
An application cannot invoke the z/OS AXSET macro after executing the CAF CONNECT call and before executing the CAF DISCONNECT call."
So, in this case the IBM DB2 Admin tool is using a CAF connection. The Db2 connection type, hlq.CDBAPARM(SETUPxx) CONNECT(AUTO) is the parameter option that
enables the Database Management Solutions for Db2 for z/OS to switch to RRSAF as required.
As the Db2 Admin Tool is using CAF and Batch Processor is using RRSAF, the problem of simultaneous accesses (CAF and RRSAF) is the reason for the PTIDB2-CAF message.
When the user has CONNECT (AUTO) in SETUPxx and does not have a split screen (no other application running) the ISQL / Batch Processor does not have a problem
with the RRSAF setting being used.
Connections to DB2 for application programs
RRSAF Authorization in the Database Management Solutions for DB2 for z/OS
"Update the hlq.CDBAPARM(SETUPxx) member to specify AUTO for the Db2 connection type, CONNECT(AUTO). This parameter option enables the Database Management Solutions
for DB2 for z/OS to switch to RRSAF as required."