[EJB 3.0] - Re: Bug: Injected EJB objects instantiated on every MDB call
by doktora
"adrian(a)jboss.org" wrote : As I commented on the "bug" report. This is not JMS, this is EJB3.
|
| OFF TOPIC - use the ejb3 forum rather than respond to this post.
|
| It isn't clear to me what you are doing, but it doesn't look like a bug to me.
| It looks like you don't understand that ejbs are pooled and/or that multiple copies
| of an entity bean can exist simultanously,
| e.g. for optimisitic locking
|
| To have singletons you need to use some form of pessimistic locking which is usually not
| very performant.
Hi Adrian,
Apologies for posting on the wrong forum, but the issue seems to present itself only in MDBs, therefore my assumption that it was an MDB problem. I didn't write the code, so you might be right.
I think my understanding of pooling is pretty good, ergo the post and the "Bug" in the title. I'm pretty sure this is broken:
After making 351 requests, how many instances of RecordManagerBean do you think were created? The answer is, 351. postConstruct was called 351 times and preDestroy was called 0 times, so none of these instances were claimed back. Is there a fault in my understanding of how this should work?
What happened on the 352'nd request? Here:
Can't create thread: 5
| 13:34:45,519 ERROR [JmsServerSession] Unable to schedule work
| javax.resource.spi.work.WorkRejectedException: org.jboss.util.threadpool.ThreadPoolFullException: java.lang.OutOfMemoryError: unable to create new native thread
| at org.jboss.resource.work.WorkWrapper.rejected(WorkWrapper.java:250)
| ...
|
JBoss is started with -Xms128m -Xmx512m, so maybe these memory settings will make it easier to replicate the bug.
Here is also a script to call the calculator injection mdb 3 times every second:
URL="http://<YOURIP>:8080/EJB3Trail/serviceobjects/injection/calculator.jsp?action=send&start=25&end=65&growthrate=0.08&saving=300&submit=Calculate"
|
| out=/dev/null
| content=/dev/null
|
| i=0
| while [ $i -ne 500 ]; do
| i=`echo "1 + $i" | bc -q`
| echo $i
| wget $URL --output-file $out --output-document $content
| wget $URL --output-file $out --output-document $content
| wget $URL --output-file $out --output-document $content
| sleep 1
| done
Please be so kind to ponder on my comments and reconsider whether it still looks like I don't understand ejb's and pooling.
Also consider that jaikiran independently verified this with his own code.
Also consider the fact that this behaviour does not occur if we do not use MDB, i.e. just by using stateless beans.
Kind regards
Dok
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140142#4140142
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140142
16 years, 9 months
[Beginners Corner] - Problems with JBPM BPEL Hello World example
by ami999
I am following the user guide of JBPM BPEL and trying to test the Hello World example. I have had no exceptions till step 5.3.3
After deploying the business process definition, I am trying to test it using the following:
ant test
I get the following error on the console:
------------------------------------------------------------------ (console)
C:\Personal\BPM\bpel\jbpm-bpel-1.1.GA\examples\hello>ant test
Buildfile: build.xml
detect.wsdl:
get.published.wsdl:
check.mapping:
generate.mapping:
detect.mapping.tool:
BUILD FAILED
C:\Personal\BPM\bpel\jbpm-bpel-1.1.GA\examples\common\mapping-build.xml:148: The following error occurred while executing this line:
C:\Personal\BPM\bpel\jbpm-bpel-1.1.GA\examples\common\mapping-build.xml:68: c:\dev\jboss-4.2.2.GA\client not found.
-----------------------------------------------------------
The issue above seems to be the target directory. My Jboss install is in C:\Personal\jboss. For some reason it is thinking it should copy to C:\dev\jboss-4.2.2.GA
Do I need to set JBOSS_HOME or some variable? Other steps worked fine so far.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140128#4140128
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140128
16 years, 9 months