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 » reading the database by 2 brokers

Post new topic  Reply to topic Goto page Previous  1, 2
 reading the database by 2 brokers « View previous topic :: View next topic » 
Author Message
smdavies99
PostPosted: Mon Oct 05, 2015 10:37 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

There is one consideration that I don't see being mentioned

That is how long will the lock be in place? What if the App that initiates the lock hangs? What will happen then?
What will happen to the other uses of this DB resource?
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
mqlover
PostPosted: Tue Oct 06, 2015 1:35 am    Post subject: Reply with quote

Disciple

Joined: 25 Jul 2010
Posts: 176

Thanks for your suggestion. But in our code we are not using any cursor!
Our code is as follows :
Quote:

SET seqnum=SELECT sequence number from table T
check if sequence number is NULL
then
insert sequence number to the table T
chec if sequence number has reached MAX
then
update sequence number to 1
else
update sequence number to sequence number + 1


So shall I use the "SET seqnum = SELECT sequence number from table T for UPDATE" ?

pls suggest.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Oct 06, 2015 11:00 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20767
Location: LI,NY

IIB has nothing to do with the sequence number and does not know what the max seq number is... So this whole operation should be performed by the stored procedure on the DB. Just request the next seq number and have a stored proc deliver it to you.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqlover
PostPosted: Tue Oct 06, 2015 10:35 pm    Post subject: Reply with quote

Disciple

Joined: 25 Jul 2010
Posts: 176

As am not conversant with stored procedure just checking if by creating ESQL procedure would solve in any way? I suppose that SP should be written in some language and called from ESQL code.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Oct 07, 2015 4:14 am    Post subject: Reply with quote

Grand High Poobah

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

mqlover wrote:
As am not conversant with stored procedure just checking if by creating ESQL procedure would solve in any way?


I don't see how

mqlover wrote:
I suppose that SP should be written in some language and called from ESQL code.


A stored procedure would be written in SQL and stored on the database. The clue's in the name.

A stored procedure is nothing more than a sequence of SQL statements (like the SELECT) wrapped in a procedural language and run on the database server rather than passed down from a client. Which is the advantage in your circumstance.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » reading the database by 2 brokers
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.