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 » javacompute database query

Post new topic  Reply to topic Goto page Previous  1, 2
 javacompute database query « View previous topic :: View next topic » 
Author Message
ibolui
PostPosted: Tue Aug 17, 2010 1:20 am    Post subject: Reply with quote

Novice

Joined: 10 Aug 2010
Posts: 22

thanks smdavies99!

i think that may be what i am looking for. but i have no clue and exp at all..

i have googled abit and BEGIN ATOMIC is part of ESQL? can it be used in javacompute node?

can you guide me how it shall be implemented? or is there a tutorial/sample online?

thanks
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Aug 17, 2010 1:28 am    Post subject: Reply with quote

Jedi Council

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

I am afraid that this is all ESQL.
however, you can use the data setup in the Environment folder in a JCN.

Are you one of the sites that is Java only?
_________________
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
ibolui
PostPosted: Tue Aug 17, 2010 1:33 am    Post subject: Reply with quote

Novice

Joined: 10 Aug 2010
Posts: 22

yes.. is a all java thing
sorry.. what is data setup in the Environment folder in a JCN?
Back to top
View user's profile Send private message
saurabh867
PostPosted: Tue Aug 17, 2010 2:59 am    Post subject: Reply with quote

Voyager

Joined: 13 Jun 2010
Posts: 78

Did you try using any connection pooling apis eg : apache-connection-pool.

Regards,
Saurabh
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Aug 17, 2010 3:30 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Connection Pooling won't necessarily help.

A Java singleton will be available and persistent during the lifetime of a given JVM, in the case of broker this is the entire execution group.

When I asked if the data had to be read each time, and the answer was given as "yes", I don't see how maintaining a cache will help either.

Look at the Cache SupportPac anyway.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Aug 17, 2010 9:39 am    Post subject: Reply with quote

Grand High Poobah

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

ibolui wrote:
thanks smdavies99!

i think that may be what i am looking for. but i have no clue and exp at all..

i have googled abit and BEGIN ATOMIC is part of ESQL? can it be used in javacompute node?

can you guide me how it shall be implemented? or is there a tutorial/sample online?

thanks

The equivalent of ATOMIC for java would be to have a serialized modifier.

[edit]Shame on me. I meant of course synchronized [/edit]
_________________
MQ & Broker admin


Last edited by fjb_saper on Wed Aug 18, 2010 8:23 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Tue Aug 17, 2010 2:01 pm    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
The equivalent of ATOMIC for java would be to have a serialized modifier


I think you meant synchronized
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
ibolui
PostPosted: Tue Aug 17, 2010 5:23 pm    Post subject: Reply with quote

Novice

Joined: 10 Aug 2010
Posts: 22

Quote:
When I asked if the data had to be read each time, and the answer was given as "yes", I don't see how maintaining a cache will help either.


maybe to be clearer in what i am trying to do.. as part of the flow, i will query the database for extraction of some 'profiles' which will be used to determine where to route the messages..

Quote:
I think you meant synchronized

hmmm.. i thought synchronized is used for threads issues? how will it helps to improve the database query performance?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Aug 18, 2010 2:20 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

smdavies99's solution to this problem was to preload the data at regular intervals in a separate flow using a timer node. The data was then stored in an ESQL shared variable, and BEGIN ATOMIC blocks were used around the access points into this shared variable to ensure that access to it was synchronized.

If the data is different enough each time the flow is run such that the data has to be read each time the flow is run - which you have stated! - then this solution can't be done.

But if this solution CAN be done, AND you want to do it in Java, then you can use a Java singleton class with appropriate synchronized modifiers.

Or, as I said, you could choose not to reimplement this wheel and use the Cache supportPac instead.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Aug 18, 2010 10:23 am    Post subject: Reply with quote

Grand High Poobah

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

mgk wrote:
Quote:
The equivalent of ATOMIC for java would be to have a serialized modifier


I think you meant synchronized

Of course. Silly me I need more tea...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
ibolui
PostPosted: Wed Aug 18, 2010 5:18 pm    Post subject: Reply with quote

Novice

Joined: 10 Aug 2010
Posts: 22

Quote:
If the data is different enough each time the flow is run such that the data has to be read each time the flow is run - which you have stated! - then this solution can't be done.

sorry! my bad.. i do not mean the data is different enough each time the flow is run. what i meant is that for each flow, i need to fetch the data inorder to determine where to route the message to..

thanks for the explanation. i seem to understand smdavies99's solution better now. i shall try implementing it..
Back to top
View user's profile Send private message
ibolui
PostPosted: Thu Aug 19, 2010 6:00 pm    Post subject: Reply with quote

Novice

Joined: 10 Aug 2010
Posts: 22

i think i have gotten it to work. i followed the Message Routing Sample that comes with the broker..

thanks everyone
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 » javacompute database query
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.