-
1. Re: MDB pool configuration & EJB3
jc7442 Apr 11, 2006 12:48 PM (in response to jc7442)It seems that annotation:
@PoolClass(maxSize=2,value=StrictMaxPool.class)
solves the problem for my MDB. Is it possible to specify the same thing with XML ? -
2. Re: MDB pool configuration & EJB3
bill.burke Apr 11, 2006 1:26 PM (in response to jc7442)you can do annotation overrides in the
ejb3-interceptors-aop.xml
You have to pick the right "domain" though...apologies for the poor doco. -
3. Re: MDB pool configuration & EJB3
jjklappenbach Apr 12, 2006 2:51 AM (in response to jc7442)One way is presented in the test classes provided with the source distribution of JBoss 4.0.3SP1. The example uses annotations to configure the pool, but each annotation has its descriptor analog.
Look for the file StrictlyPooledMDB.java. The lines you will find of interest:
@PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=StrictlyPooledMDB.maxActiveCount, timeout=10000)
where StrictlyPooledMDB.maxActiveCount is an int defined in the class to establish the maximum number of threads.
Your milage may vary here, as setting maxSize to low values can result in JMS subsystems exceptions.
-jjk -
4. Re: MDB pool configuration & EJB3
judge2005 Apr 17, 2007 11:14 PM (in response to jc7442)And in case anyone is wondering. This is how you do the same thing in jboss.xml:
<?xml version="1.0" encoding="UTF-8"?> <jboss xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss_5_0.xsd" version="3.0"> <security-domain>java:/jaas/example-domain</security-domain> <enterprise-beans> <message-driven> <ejb-name>sample.MDB</ejb-name> <pool-config> <pool-class>org.jboss.ejb3.StrictMaxPool</pool-class> <pool-max-size>1</pool-max-size> <pool-timeout>5000</pool-timeout> </pool-config> </message-driven> </enterprise-beans> </jboss>
BTW thanks for this thread. You saved my bacon. And thanks to Eclipse for having an XML editor that understands xsd. Oh and thanks to JIRA for showing that the xsd existed!
Finally I'd like to thank my producer... j/k - its late. -
5. Re: MDB pool configuration & EJB3
wolfc Apr 19, 2007 2:43 AM (in response to jc7442)Before you get your hopes up out of old posts, note that pool configurations on a MDB is not the way to go. http://jira.jboss.com/jira/browse/EJBTHREE-890
Also note that expiration of messages is an issue. http://jira.jboss.com/jira/browse/EJBTHREE-938 -
6. Re: MDB pool configuration & EJB3
ejb3workshop Nov 22, 2007 6:46 AM (in response to jc7442)I am having a problem following your suggestion. I increased by session size to 20 using :
@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "20"
but now I get the following exception :Failed to acquire the pool semaphore, strictTimeout=10000
A search on the forum suggestion that I need to increase my MDB pool size to boyond the number of the sessions.
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=58293
However you suggest that this is not the way to go. I tried it and it didn't work. It complained about the jboss.xml file not being correct.
Is there another solution to the Failed to acquire the pool semaphore, strictTimeout=10000 ?
Thanks
Alex