1 Reply Latest reply on Mar 7, 2002 10:01 PM by Peter Murray

    SUPPORTED transaction attribute - should it lock the receive

    Peter Murray Newbie

      Greetings folks,

      So, I have a fundamental question about JBoss's interpretation of the EJB spec. It seems in JBoss 2.2.2 that if I have a method that is marked SUPPORTED for a container managed transaction attribute, and that method is invoked, the instance becomes a part of the current transaction - and is thus 'locked' for the duration of the transaction. Is this necessarily what the EJB spec dictates? If so, where in the spec to they talk about this sort of issue?

      An example where this is awkward is: Suppose I have an entity bean representing a person (call it Person), on that bean is a method called 'giveChildrenAllowance()'. This method iterates over the Person's children and increments their piggy-bank balances. If i declare that this method has 'SUPPORTS' for the trans-attribute, we end up 'locking' that Person for the duration of the transaction even though it's state really hasn't changed at all. None of the other transaction attributes seem to give me what I want in this case, but it seems that (from what I read) the SUPPORTS attribute could be interpreted as 'pass the transaction context along, but don't associate this object with the context as a result of this call' - after all - SUPPORTS indicates that really the method doesn't care whether there is a transaction in place or not.

      Does this make sense? Am I smoking the crack-pipe or would that be a reasonable interpretation of the spec? If reasonable, how do I go about submitting patches?

      Cheers,

      pete
      peter m. murray
      pete@subx.com

      PS: For those of you who would recommend I write some kind of session bean that would give the children allowance - I'm hoping to avoid doing that as it's much cleaner just to ask the parent object to do it.
      -pmm