The transaction attribute of the EJB method must work with local or remote interface.

xiaoxiao2021-03-06  103

Question: The two libraries to be accessed in the program are originally on the same server (SQL Server7), but now one of the libraries should be ported to Oracle. In this way, our program is to access two libraries on different servers, and SQL Server7 does not support distributed transactions, so we set a lot of transaction properties that access the EJB methods of SQL Server7 to not support. Different EJB calls work very well, but an EJB method to access the same EJB, and this method called just right to access SQL Server, it is directly called. It's now a problem.

Solve: Save a reference to this EJB local interface in this EJB, call the EJB method through this reference. OK

Conclusion: The EJB transaction attribute of container management must work through local or remote interface calls. Especially note that the call between the same bean is sometimes called through the local interface.

转载请注明原文地址:https://www.9cbs.com/read-106757.html

New Post(0)