OK, here's a test case that recreates the problem for me.

I've attached test.jar which is the ejb-jar and also includes the test case class. Also attached is test-src.jar which has the source code for the EJBs and the test. I'm afraid I've been hacking around existing build scripts to create the test so I've not included any way of building the code. I'm using an older version of XDoclet.

There are 2 entities, Parent and Child. The CMRTest class creates multiple threads to call the getPropertyMap() method on the Parent. This method iterates around the CMR collection of children, and when multiple threads are run causes occasional CMR errors.

In jbosscmp-jdbc.xml the datasource is java:/jdbc.testPool and the mapping is for Oracle8. My test doesn't create the test data, so I've manually inserted data before running the test. I've found that it's only necessary to have one child record to recreate the problem.

The CMRTest class takes 3 arguments - the parent primary key, number of threads, number of loops per thread. e.g.:

java com.ingenta.acs.test.ejb.CMRTest test1 30 100

30 threads with 100 loops always causes at least one CMR error for me. I've tested on two setups, both of which cause errors.

1) Solaris, Sun JDK1.3.1, JBoss 3.2.0RC3, Oracle 8.1.7.2.0
2) Linux (Mandrake 9), Sun JDK1.4.1, JBoss 3.2.0RC4, Oracle 8.1.7.2.0

jboss.xml in the ejb-jar declares all get* methods to be read-only. If I remove this the CMR error does not occur, but the test goes a lot slower.

Let me know if there's any more information you need.

Andrew

Dain Sundstrom wrote:

I fixed a similar bug in this stuff for Sacha on March 19th (version 1.43.2.13). The problem was registering for transaction synchronization on the transaction in the context and not the transaction associated with the current thread. This bug created the type of problem you have described, but the fix should bin in 3.2 rc4.

Until someone can create a test case that reproduces the new bug, I don't think there is much we can do.

-dain

On Friday, March 28, 2003, at 10:01 AM, Alex Loubyansky wrote:

Hello Andrew,

you are not alone complaining about this. But nobody could produce a
testcase that fail at least eventually.

I am trying to reproduce it but can't for the moment.

I have a Parent and 1000 of related Child entities.
I have 100 concurrent threads finding parent by primary key, getting
children and iterating through relation collection.
I use standard container for both Parent and Child.
In jboss.xml get methods are read-only for both Parent and Child.

Any more info you can provide? Again a testcase would be great. Let it
fail not each time but eventually.

Thank you,
alex



Attachment: test-src.jar
Description: Binary data

Attachment: test.jar
Description: Binary data

Reply via email to