Posted: Wed Jun 04, 2008 6:52 am Post subject: ATOMIC BLOCKS
Voyager
Joined: 12 Jun 2007 Posts: 98
Hi ,
I am trying to remove the element from the atomic row.But I am ending up with the exception which says :
-----------------------------------------------------------------------------
BIP2503
Invalid shared variable operation.
Severity
20 : Error
Explanation
An SQL statement has attempted an operation involving shared variables which is outside the range permitted. You cannot move (by using DETACH/ATTACH) a subtree from one shared variable to another. You cannot use functions with side effects to change shared variables when the expression invoking the function also operates on shared variables.
Response
Correct the logic of the ESQL program and re-deploy the message flow.
The piece of code which is causing the exception is :
SharedMutex2:BEGIN ATOMIC
X: WHILE i < MaxConn DO
SET storeCookie.cookieList[i] = storeCookie.cookieList[i+1];
SET i = i + 1;
END WHILE X;
END;
The italisized line above throws the exception. There was no such error when executed in 6.0.0.1 version of MB. This exception occured when this piece of code was executed in 6.0.0.7.
Please share your view points on these.
-------------------
SET storeCookie.cookieList[i] = storeCookie.cookieList[i+1];
is trying to read and write from the same shared variable in the same statement. This is not allowed, and it looks like this was tightened up after 6.0.0.1 . To work around this simply store the value in a local variable and then assign it. e.g:
Code:
SET temp = storeCookie.cookieList[i+1];
SET storeCookie.cookieList[i] = temp;
regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum