3 Replies Latest reply on May 21, 2007 9:28 PM by smarlow

    Row-locking enhancement for ejbLoad invoked outside of a tra

    smarlow

      Hi,

      I have a cmp bean method marked with "transaction-type=NotSupported". I would like the ejbLoads that occur for calls to this method, to act as if row-locking=false. I want this for the cases that the parent transaction holds a row lock on the same entity bean.

      Would this be a valid ehancement to JDBCLoadEntityCommand.execute(JDBCCMPFieldBridge requiredField,
      EntityEnterpriseContext ctx)? We can easily test the ctx if a transaction is active, if not, don't use the row-lock syntax.

      Should there be an option perhaps that controls this?

      Thanks,
      Scott

        • 1. Re: Row-locking enhancement for ejbLoad invoked outside of a
          smarlow

          Just to give more information about the use case. The target ejb2 cmp bean method is performing a read-only batch operation on many rows in the database (get application user group membership list).

          This method is marked with "@ejb.transaction type=NotSupported" and the bean has row-locking=true.

          I'm thinking that the row-locking should be disabled for this case since there is no active transaction.

          This is an edge case but I think its worth addressing. I'll Jira it and fix it if there is agreement that its safe to fix. I didn't want to Jira it if were not going to fix it.

          Thanks,
          Scott

          • 2. Re: Row-locking enhancement for ejbLoad invoked outside of a
            aloubyansky

            In theory that sounds ok. But we do not recommend accessing entity beans w/o a transaction in our implementation. Some code relies on an active transaction.

            • 3. Re: Row-locking enhancement for ejbLoad invoked outside of a
              smarlow

              I created JBAS-4433 to track this and noted that active transactions are recommended when accessing entity beans. JBAS-4433 is about ignoring the row-lock flag if there is no active transaction.