diff --git a/ToolkitApi/Toolkit.php b/ToolkitApi/Toolkit.php index e47abb7..d12e870 100644 --- a/ToolkitApi/Toolkit.php +++ b/ToolkitApi/Toolkit.php @@ -75,6 +75,7 @@ class Toolkit '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 @@ -144,7 +145,7 @@ public function __construct($databaseNameOrResource, $userOrI5NamingFlag = '0', } // 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('stateless_mode_default','stateless','v5r4', 'ccsidBefore', 'ccsidAfter', 'useHex', 'paseCcsid', 'trace', 'dataStructureIntegrity', 'arrayIntegrity')); $this->getOptionalParams('transport', array('httpTransportUrl', 'plugSize')); // populate serviceParams with $transport, or get it from INI @@ -1734,7 +1735,12 @@ public function getInternalKey() */ public function isStateless() { - return $this->getOption('stateless'); + if ($this->getIsCw()){ + return $this->getOption('stateless'); + } + else{ + return $this->getOption('stateless_mode_default'); + } } /** diff --git a/ToolkitApi/toolkit.ini b/ToolkitApi/toolkit.ini index d0d3837..e1929b0 100644 --- a/ToolkitApi/toolkit.ini +++ b/ToolkitApi/toolkit.ini @@ -60,8 +60,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) -stateless = true +; CW stateless flag +; stateless mode is default for i5_connect (though automatically overridden if private conns are used) +stateless = false +; Non-CW Stateless flag - default to true +; 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 = true [transport] ; transport type allows configuration of transport from this INI.