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 » MbSQLStatement problem

Post new topic  Reply to topic
 MbSQLStatement problem « View previous topic :: View next topic » 
Author Message
marco
PostPosted: Wed Oct 12, 2005 12:29 am    Post subject: MbSQLStatement problem Reply with quote

Apprentice

Joined: 16 Feb 2004
Posts: 46

Hi,

I'm writing a plugin-node to browse some Q's on certain intervals. (to see if the messages are picked up)
When initializing the node I create and fill 2 arrays, one with the queues an one with the intervals.
The data is in a DB2 table so I have to execute a statement.
(this code is only executed during init !! )

Now the problem :

when I put a message on a queue, the node does it's work, after the specified interval, the message is propagated to the out-terminal.
In debug this is :
Message
-> Properties
-> MQMD
-> BLOB
works perfect ...

I then delete the message and put a new message on the queue, again, after the speciefied interval the message is propagated
In debug :
Message
-> Properties
-> XML
-> XML Parsing Errors have occured

I've tested the "firstParserClassName" before creating the assembly to be propagated, and it still is "MQHMD" !!


To thicken the plot I can add the following :
When using a similar function that creates and fills the arrays via a jdbc-connection everything works perfect, even the second message.


What am I missing here ?


Tx
Marco



the function :


private void getQueues_brk(MbMessageAssembly assembly) throws MbException
{
MbMessage msg = createMessage("test".getBytes());
MbMessageAssembly temp = new MbMessageAssembly(assembly,msg);
MbSQLStatement state = createSQLStatement( database, "SET OutputLocalEnvironment.Q[] = PASSTHRU('"+query+"');" );
state.setThrowExceptionOnDatabaseError(false);
state.setTreatWarningsAsErrors(true);

state.select( assembly, temp );
if (DEBUG)log("the statement was executed");

MbElement root = temp.getLocalEnvironment().getRootElement();
MbElement mb_q[] = root.getAllElementsByPath("Q");

lq = new MQQueue[mb_q.length];
qNames = new String[mb_q.length];
interval = new int[mb_q.length];
testInterval = new long[mb_q.length];
qAmount = mb_q.length;

for(int i=0; i<mb_q.length;i++)
{
if(DEBUG) log("queue: "+(String)mb_q[i].getFirstChild().getValue());
qNames[i] = (String)mb_q[i].getFirstChild().getValue();

if(DEBUG) log("interval: "+((Integer)(mb_q[i].getFirstChild()).getNextSibling().getValue()).toString());
interval[i] = ((Integer)(mb_q[i].getFirstChild()).getNextSibling().getValue()).intValue();
}

destroyMessageAssembly(temp);

openQueues(-1);
}
Back to top
View user's profile Send private message
marco
PostPosted: Wed Oct 12, 2005 11:15 pm    Post subject: Reply with quote

Apprentice

Joined: 16 Feb 2004
Posts: 46

I found the solution, but I don't know what the actual reason is ...

The problem is the creation of the dummy messageassembly for running the statement :

MbMessage msg = createMessage("test".getBytes());
MbMessageAssembly temp = new MbMessageAssembly(assembly,msg);

if I run the statement on the original assembly (state.select( assembly, assembly); )
there is no problem ...


Does anyone have an idea why this is ?
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 » MbSQLStatement problem
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.