tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ravindranath Akila <>
Subject Re: REQUIRES_NEW within a NEVER transaction throwing an exception, bug or misuse?
Date Wed, 10 Feb 2010 15:27:56 GMT
  I am sorry for the belated reply. I am continuing the thread to see if
this is an issue/shortcoming with OpenEJB or Specs itself as now the
transactional hierarchy I use avoids this scenario.

I was using version 3.1.1 AFAIK when encountering the problem but now I am
at 3.1.2. Not sure. Sorry about that.

Always my database operations have been withing stateless beans and never
within a stateful bean.

Actually I seek clarification on OpenEJB side. Is it just that the
specification does not mention if this kind of nesting(flat) is possible, or
is it that the EJB implementations are supposed to decide whether to support
it or not.

Finally, it would be great if we can actually come up with the nesting
scenarios available as which are supported and which not.

IMHO, having a REQUIRES or REQUIRES_NEW within any other transaction type,
should work.

>  I have an operation on which
>> one is a dirty read, so the transaction scope is NEVER
>> and the other requires a transaction, hence REQUIRES_NEW.
>> I need to call both these in the same bean so unless I mark this caller
>> method otherwise, it defaults.
>> Therefore I tried marking it NEVER, NOT_SUPPORTED and SUPPORTS but all
>> these
>> throw exceptions.
>> Caller Method = A
>> Called Methods = B and C
>> B => NEVER, NOT_SUPPORTED (this is the dirty read)
>> A calls B, then C
>> it seems that using ANY transaction scope, i.e. all enlisted in
>> transactionattribute class I cannot call both the two other methods, one
>> not
>> supporting or rejecting a transaction(B) and the other requiring a new
>> one(C).
>> I agree that nested transactions are not supported in EJB, but if the
>> caller(A) is marked NEVER, NOT_SUPPORTED or SUPPORTS, and was called from
>> an
>> ordinary method(having no transaction scope), then it should not impose
>> any
>> transaction to methods IT calls. It if it does, it should sleep and let
>> them
>> handle it from there. I could not find anything on Google or the Sun
>> tutorial.
> Do you know what OpenEJB version you are using?
> Also is the bean in question a stateful session bean?  And is there a
> transaction in progress in which the stateful bean is participating when
> method A is called?
> I.e. is the stateful bean inside a transaction when you attempt to invoke a
> method on it outside the transaction via a NEVER or NOT_SUPPORTED method?
> -David
  Ravindranath Akila...

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message