Re: Contexts and Connections, how many are needed
Tim Anderson <[email protected]> Wed, 06 Jun 2007 23:38:46 +1000
| Newsgroups | gmane.comp.java.openjms.user |
|---|---|
| Message-ID | <[email protected]> |
George H wrote: > Hi, > > If I have a program that has a durable subscriber for 4 topics do I > need to have a separate context and connection object per topic for > each durable subscriber ? > > When I first started using openjms I found out that I got many > exception when I use a single context and connection to do this. I had > to resort to a context/connection object per topic to have a durable > subscriber for each. I've have not read anywhere if this was actually > needed or if I was just doing something the hard way when there was a > simpler way to do it. > > Does anyone have any tips and/or suggestions on this matter? > > Thanks in advance. > > No. You can use the one context and connection for all topics. What exception were you getting? One thing you need to watch out for is when you use Sessions. They can only be accessed via a single thread at a time. -Tim ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/