Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Greetings,

Not sure if this is one for here or stackoverflow but here goes:

I have deployed a J2EE application on JBoss 4.2 with a MySQL backend. While stress testing the application I've discovered many:

 org.jboss.tm.JBossTransactionRolledbackException: Contention on read lock promotion for bean.  Exception in second transaction; nested exception is: 
javax.ejb.EJBException: Contention on read lock promotion for bean.  Exception in second transaction; - nested throwable: (javax.ejb.EJBException: Contention on read lock promotion for bean.  Exception in second transaction)

How would you advise I debug this?

Thanks in advance.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I solved this by creating a file called "jboss-container.xml" in ejbmodule/META-INF/.

The contents of this file is:

<container-configurations>

    <container-configuration extends="Standard CMP 2.x EntityBean">

        <container-name>DeadlockAvoidingConfiguration</container-name>
        <instance-cache>org.jboss.ejb.plugins.PerTxEntityInstanceCache</instance-cache> 
        <locking-policy>org.jboss.ejb.plugins.lock.NoLock</locking-policy>
        <commit-option>C</commit-option>
    </container-configuration>

</container-configurations>

I am aware that this is not an optimal solution (due to the effect on caching ), but it fixes the errors.

Feel free to add to this.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.