I posted this JBOSS/EJB also. Please help.
I finally got it to perform somewhat muti-tasking now.
I am using jboss3 final, and CMP.
I did it by setting the locking policy to org.jboss.ejb.plugins.lock.MethodOnlyEJBLock and set my stateless bean transaction attribute to requiresnew.
It looks like long transactions are not blocking other transactions from the users point view. However, transactions are put in a queue and handled in a single task manner.
I wish someone could tell me how to have these inserts in the transactions happen concurrently.
I basically have one stateless sessionbean that has a method that does a lot of insert in a container managed transaction (RequiresNew) (10minutes). I have 2 clients calling it, it seems server is doing transaction one by one.
Some one please help.
I have two segestions for you. First, make sure that there is not some common bean that is found and accessed as reference when creating the inserts. This would explain why the transactions are waiting.
Socond, is it necessary that these many inserts be in the same transaction? If not break up the method into two. The first method should be set to NotSupported and within that method generate an array of info you want to insert. The second method should be set to Required (default) and it would actually do the create of one bean. Make sure to access the second method from the first through sessionContext.getEJBLocalObject() so that JBoss seperates it into a transaction. In this way, each insert is a seperate transaction and any other queries will be folded into the queue during the 10 minutes.
Contact me by email if I can be of further help.