Skip to content

Commit 8cec8ce

Browse files
committed
Add second stateless flag for XML toolkit. Check if call is being made from compatibility wrapper and use appropriate stateless flag.
1 parent 7fa29cb commit 8cec8ce

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

ToolkitApi/ToolkitService.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ class ToolkitService
9797
'sbmjobCommand' => '', // optional complete override of SBMJOB command when new toolkit job is submitted
9898
'prestart' => false,
9999
'stateless' => false, // overriden by value in toolkit.ini if it is present (system section)
100+
'xmlstateless' => true, // add new stateless flag for XML toolkit
100101
'performance' => false, // whether to enable performance collection (not fully implemented)
101102
'idleTimeout' => '', // created for Compat. Wrapper (CW)
102103
'cdata' => true, // whether to ask XMLSERVICE to wrap its output in CDATA to protect reserved XML characters
@@ -225,7 +226,7 @@ protected function __construct($databaseNameOrResource, $userOrI5NamingFlag = '0
225226
}
226227

227228
// Optional params. Don't specify if not given in INI.
228-
$this->getOptionalParams('system', array('stateless','v5r4', 'ccsidBefore', 'ccsidAfter', 'useHex', 'paseCcsid', 'trace', 'dataStructureIntegrity', 'arrayIntegrity'));
229+
$this->getOptionalParams('system', array('xmlstateless','stateless','v5r4', 'ccsidBefore', 'ccsidAfter', 'useHex', 'paseCcsid', 'trace', 'dataStructureIntegrity', 'arrayIntegrity'));
229230
$this->getOptionalParams('transport', array('httpTransportUrl', 'plugSize'));
230231

231232
// populate serviceParams with $transport, or get it from INI
@@ -1749,7 +1750,12 @@ public function getInternalKey()
17491750
*/
17501751
public function isStateless()
17511752
{
1752-
return $this->getOption('stateless');
1753+
if ($this->getIsCw()){
1754+
return $this->getOption('stateless');
1755+
}
1756+
else{
1757+
return $this->getOption('xmlstateless');
1758+
}
17531759
}
17541760

17551761
/**

ToolkitApi/toolkit.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ dataStructureIntegrity = true
6060
; For backward compatibility with pre-1.4.0, set to false.
6161
arrayIntegrity = true
6262

63+
; CW stateless flag
6364
; stateless mode is default for i5_connect (though automatically overridden if private conns are used)
6465
stateless = false
66+
; Non-CW Stateless flag - default to true
67+
; This should be overridden if you require stateful connections
68+
xmlstateless = true
6569

6670
[transport]
6771
; transport type allows configuration of transport from this INI.

0 commit comments

Comments
 (0)