ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SHARED Variable in ESQL for Integration Service (SOAP)

Post new topic  Reply to topic
 SHARED Variable in ESQL for Integration Service (SOAP) « View previous topic :: View next topic » 
Author Message
mhasan23
PostPosted: Wed Apr 24, 2019 10:10 pm    Post subject: SHARED Variable in ESQL for Integration Service (SOAP) Reply with quote

Novice

Joined: 12 Oct 2017
Posts: 20

Hello all,

I have created an integration service (SOAP based web service), all things are working fine. What I need to safe the hit on database every time when my web service API calls from application or mobile; so I am trying to store some database tables with long live variables for re-usability. So I tried "SHARED" variable concept in integration service project. But the variable is populated only for the single API cycle means when request received variable populated for entire flow cycle when response sends then variable will be null.

Is there any other way around or I am doing anything wrong with this "SHARED" variable.

Code:
DECLARE DB_RESPONSECODES SHARED ROW;


This is how i declared SHARED variable.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Apr 25, 2019 4:50 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Without seeing the rest of your code, I would posit that the SHARED variable you're declaring is not in scope for the next iteration / API call.

You might want to consider using the global cache for this.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mpong
PostPosted: Thu Apr 25, 2019 5:44 am    Post subject: Reply with quote

Disciple

Joined: 22 Jan 2010
Posts: 164

Quote:
Is there any other way around or I am doing anything wrong with this "SHARED" variable.


You should be able to achieve this using Shared variable. Can you try something like this?

DECLARE CACHE_COUNT SHARED ROW NULL;

SET CACHE_COUNT .GroupName = InputRoot.DFDL.BulkRecordOutput.record.EmailGroup;
Back to top
View user's profile Send private message
mhasan23
PostPosted: Thu Apr 25, 2019 10:17 pm    Post subject: Reply with quote

Novice

Joined: 12 Oct 2017
Posts: 20

@Vitor Thanks a lot it works

Code:
DECLARE CACHE_COUNT SHARED ROW NULL;

SET CACHE_COUNT .GroupName = InputRoot.DFDL.BulkRecordOutput.record.EmailGroup;


This code is working. Thanks again
Back to top
View user's profile Send private message
mhasan23
PostPosted: Thu Apr 25, 2019 10:19 pm    Post subject: Reply with quote

Novice

Joined: 12 Oct 2017
Posts: 20

@mpong thanks alot
Back to top
View user's profile Send private message
timber
PostPosted: Thu Apr 25, 2019 11:40 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

One thing to be aware of: when using SHARED variables, you sometimes need an ATOMIC block around the updates to ensure that multiple message flow instances can safely use the same variable. Only required if additionalInstances > 0.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SHARED Variable in ESQL for Integration Service (SOAP)
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.