1 Reply Latest reply on May 7, 2005 5:11 AM by schrouf

    Instance per transaction entity bean and optimistic locking

    sureshmv8

      We had an application that used the default "standard bmp entity bean configuration" with pessimistic locking. The application used to hang and get into deadlocks frequently.
      The hang went away as soon as we shifted it to use "Instance Per Transaction BMP EntityBean" with NoLock. We are concerned though that this might result in concurrent update problems. My question here is:
      Is it legal to change the "Instance Per Transaction BMP EntityBean" configuration in standardjboss.xml to use optimistic locking to prevent possible concurrency problems? By default the standardjboss.xml uses NoLock for this configuration.

        • 1. Re: Instance per transaction entity bean and optimistic lock
          schrouf

          The "Instance Per Transaction ... EntityBean" configuration relies on propper SQL database level locking (That's why the entity bean container configuration itself has no locking strategy). You have to configure your database tables with the appropriate locking mode (page/row locking) and select an appropriate isolation level within your JDBC datasource ..-ds.xml.

          Regards
          Ulf