Skip to content

Commit a105894

Browse files
authored
- Fix SAP Transaction methods error (#825)
* - Fix SAP Transaction methods error when assigning empty scope before TransactionBegin/TransactionCommit Issue 106402 * - Change zero length test for isEmpty
1 parent ead04f9 commit a105894

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

java/src/main/java/com/genexus/sap/SessionManager.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ public void TransactionBegin()
153153
try
154154
{
155155
destinationName = (String)destinationObj;
156-
scopeName = (String)scopeObj;
156+
scopeName = String.valueOf( scopeObj);
157157
Log.info("GX SAP - Begin Transaction " + destinationName);
158158
JCoDestination destination = null;
159-
if (scopeName.length() == 0)
159+
if (scopeName.isEmpty())
160160
destination = JCoDestinationManager.getDestination(destinationName);
161161
else
162162
destination = JCoDestinationManager.getDestination(destinationName, scopeName);
@@ -180,12 +180,12 @@ public void TransactionCommit()
180180
try
181181
{
182182
JCoDestination destination = null;
183-
destinationName = (String)destinationObj;
184-
if ( scopeObject == null || ((String)scopeObject).length() == 0 ) {
183+
destinationName = (String)destinationObj;
184+
scopeName = String.valueOf(scopeObject);
185+
if ( scopeName.isEmpty() ) {
185186
destination = JCoDestinationManager.getDestination(destinationName);
186187
}
187188
else {
188-
scopeName = (String)scopeObject;
189189
destination = JCoDestinationManager.getDestination(destinationName, scopeName);
190190
}
191191
Log.info("GX SAP - Commit Transaction " + destinationName);
@@ -456,4 +456,4 @@ public void setRepositoryName(String value)
456456
{
457457
repositoryName = value;
458458
}
459-
}
459+
}

0 commit comments

Comments
 (0)