From bcacdc62ed101842827cbbfa48379e329b05bf63 Mon Sep 17 00:00:00 2001 From: Scott Campbell Date: Sun, 15 Feb 2015 17:20:01 -0700 Subject: [PATCH 1/2] Rebasing: Use stateless flag from toolkit.ini it is present to override value in $_options array. Add to constructor by adding to the array in getOptionalParams. Change default stateless flag to flase in the toolkit.ini to match existing functionality Add second stateless flag for XML toolkit. Check if call is being made from compatibility wrapper and use appropriate stateless flag. --- ToolkitApi/toolkit.ini | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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. From 11c949cd49f33d745a7dac3743b2a2e58dab8b69 Mon Sep 17 00:00:00 2001 From: Scott Campbell Date: Sun, 6 Nov 2016 09:30:43 -0700 Subject: [PATCH 2/2] Rebasing and re-applying changes --- ToolkitApi/Toolkit.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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'); + } } /**