java ee 6 - Is it possible to annotate a method with @TransactionAttribute in BMT EJB? -


I came upon a piece of code where the bean implementation class @ TransactionManagement (TransactionManagementType.BEAN) is Annotations in which the methods are annotated with CMT @TransactionAttribute . What is valid? Can EBB use the CMT transaction annotation with EMBT? What will be the behavior on runtime?

Although Javadoc says that "It can only be specified that container managed transaction limit is used." Specifying this, it does not throw any compilation error. Does this mean that jvm only ignores it on runtime?

  @ static (mapped name = "ABC") @ Remot ( "Abisiarmmtikclas") @ Local ( "Abisilokl. Class") @ Transaction Management (TransactionManagementTypekBEAN) public square ABBABEIN ABOLOCOL, ABCRMTECT {@ RESOURCES PRIVATE EDUCATOR, TRANSACTION UTX; Applies; @price unit private entity entertainment factory emf; @ Override @ transaction attribute (transaction Attitusn type. Requier) Public ABC got Alpababets (string name) {Entity Manager M = cord; Try {em = emf.createEntityManager (); } Hold (runtime expiry) {throw away; } Finally {}}  

If you use CMT, @TransactionAttribute (transaction AttributeType.REQUIRED) will tell the container to check the current transaction and if there is no open one.

But if you use BMT, you have a responsibility to do such a thing, so I have to follow the above comment because it is still the syntax is correct and classes available, it There is no need for JVM to complain about.

In relation to ignoring annotations, the answer is an indication.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -