1 Reply Latest reply on Oct 10, 2006 5:56 AM by oyabun

    DB2 and "select for update"

    liemmn

      Hello,

      I am using JBoss 4.0.3 and DB2 8.1. I would to obtain a pessimistic lock (row lock) for my entity bean's findByPrimaryKey() method. So, I have the row-locking set to true in my jbosscmp-jdbc.xml file and also set the row-locking-template for DB2 to "SELECT ?1 FROM ?2 WHERE ?3 FOR UPDATE" in the standardjbosscmp-jdbc.xml file.

      However, I don't see any select for update when the findByPrimaryKey() method is invoked. Is this a known issue with JBoss, or am I doing something amiss here?

      Thanks,
      Liem

        • 1. Re: DB2 and
          oyabun

          It looks like findByPrimaryKey doesn't use the row locking template for whatever reason. All other finders do. Tested with 4.0.2