Singletone bean, concurrency and transactions

Moderator: admin

Post Reply
Ciprian Mihalache
Posts: 51
Joined: Wed Sep 28, 2011 12:14 pm
Contact:

Singletone bean, concurrency and transactions

Post by Ciprian Mihalache »

Hi Paul,
I am particularly interested about this scenario:
It is given 3 interceptor classes A, B, C.
B and C are declared at type level. @Interceptors({B, C});
interceptor-A didn't declared via annotations.
And we have a following descriptor:
<assembly-descriptor>
<interceptor-binding>
<ejb-name>SomeBean</ejb-name>
<interceptor-order>
<interceptor-class>A</interceptor-class>
</interceptor-order>
<method>
<method-name>foo</method-name>
</method>
</interceptor-binding>
</assembly-descriptor>

What will be the order for invocations?
1. B, C
2. A, B, C
3. B, C, A
4. A
I couldn't find a similar question.
I found here the following: If the interceptor-order element is used, the ordering specified at the given level must be a total order over ALL interceptor classes that have been defined at that level and above (unless they have been explicitly excluded).. So, I can assume that we defined in the descriptor a method-level interceptor, thus the other 2 class-level interceptors will not be invoked anymore, so the last option is the right one. Am I right? What would be the order of interceptors if the "<method>" part is missing from the descriptor? Even more, what would be the order of interceptors if "<method>" part is missing and we have "<ejb-name>*</ejb-name>" in the descriptor?
I also found here some explanations about interceptor-order, but I admit that I was unable to follow them... :D
Could you please add couple new questions with various situations where <interceptor-order> could be used?
Thank you very much :)

admin
Site Admin
Posts: 10045
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: Singletone bean, concurrency and transactions

Post by admin »

Hi Ciprian,
I will look into this as soon as I get some time. Meanwhile could you please send us an email (support@...) with your orderid?

thank you,
Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests