1 Reply Latest reply on Dec 14, 2006 1:13 AM by weston.price

    How to set Isolation Level in EJB 3.0 (CMP)

    harisharma


      hi,

      i need info regarding " How to set Isolation Level in EJB 3.0 (CMP)"

      Problem Description :

      i have a scenario where i need to set the ISOLATION LEVEL in order to eliminate the concurrency ISSUE. i came to know that to set Isolation level we need connection object. but how to get the Connection object which is pooled by JBOSS and used by Enity manager. i have created the Connection object with the same JNDI name which is used in the JBOSS_DS.xml. but this is not working coz this is a new object which is not created and pooled by the Jboss. please let me know the way how we can get the connection object used by the Entity Manager.

        • 1. Re: How to set Isolation Level in EJB 3.0 (CMP)
          weston.price

          The only way to effectively do this would be to set the

          <transaction-isolation></transaction-isolation>

          property in your *-ds.xml file. Unfortunately, this will be applicable to *all* connections used/created by EJB3 that use that datasource. EJB3 provides no way to acquire the underlying connection used by the EntityManager and as a result you will not be able to set this property dynamically.