diff --git a/ToolkitApi/Toolkit.php b/ToolkitApi/Toolkit.php index 64be405..2de5b4d 100644 --- a/ToolkitApi/Toolkit.php +++ b/ToolkitApi/Toolkit.php @@ -86,6 +86,7 @@ class Toolkit implements ToolkitInterface 'sbmjobCommand' => '', // optional complete override of SBMJOB command when new toolkit job is submitted 'prestart' => false, 'stateless' => false, + 'stateless_mode_default' => true, // add new stateless flag for toolkit (non CW) 'performance' => false, // whether to enable performance collection (not fully implemented) 'idleTimeout' => '', // created for Compat. Wrapper (CW) 'cdata' => true, // whether to ask XMLSERVICE to wrap its output in CDATA to protect reserved XML characters @@ -176,12 +177,16 @@ public function __construct($databaseNameOrResource, $userOrI5NamingFlag = '0', // set service parameters to use in object. $this->serviceParams = $this->getDefaultServiceParams(); + /* We don't add these in getOptionalParams because the names are different */ if ($this->getConfigValue('system', 'sbmjob_params')) { $this->serviceParams['sbmjobParams'] = $this->getConfigValue('system', 'sbmjob_params'); } + if ($this->getConfigValue('system', 'stateless_mode_default')) { + $this->serviceParams['stateless'] = $this->getConfigValue('system', 'stateless_mode_default'); + } // Optional params. Don't specify if not given in INI. - $this->getOptionalParams('system', array('v5r4', 'ccsidBefore', 'ccsidAfter', 'useHex', 'paseCcsid', 'trace', 'dataStructureIntegrity', 'arrayIntegrity')); + $this->getOptionalParams('system', array('v5r4', 'ccsidBefore', 'ccsidAfter', 'useHex', 'paseCcsid', 'trace', 'dataStructureIntegrity', 'arrayIntegrity')); $this->getOptionalParams('transport', array('httpTransportUrl', 'plugSize', 'xmlserviceCliPath')); // populate serviceParams with $transport, or get it from INI @@ -1857,6 +1862,8 @@ public function getInternalKey() } /** + * See if stateless mode has been turned on. Affects both CW and not-CW. + * * @return bool|void */ public function isStateless() diff --git a/ToolkitApi/toolkit.ini b/ToolkitApi/toolkit.ini index 0a4492b..983511a 100644 --- a/ToolkitApi/toolkit.ini +++ b/ToolkitApi/toolkit.ini @@ -59,8 +59,13 @@ dataStructureIntegrity = true ; For backward compatibility with pre-1.4.0, set to false. arrayIntegrity = true -; CW only: stateless mode is default for i5_connect (though automatically overridden if private conns are used) +; CW stateless flag, true for compatibility +; stateless mode is default for i5_connect (though automatically overridden if private conns are used) stateless = true +; Non-CW Stateless flag - default to false to match original semantics +; This should be overridden if you require stateful connections +; Set the default value of 'stateless' to true, for the regular toolkit (not CW). +stateless_mode_default = false [transport] ; transport type allows configuration of transport from this INI.