Transaction attribute @Never is terribly slow

I wrote a kind of test that evaluates how various combinations of transaction attributes affect the performance of a Java EE program. The reference call calls the method annotated with the annotation "Y" from the method with the annotation "X". Transactions in my control plan cover a bank transfer situation:

@Required            @RequiresNew
theCallerMethod() -> updateAccount(Account acc)
                     @RequiresNew
                  -> updateOwner(Company c)
                     @RequiresNew
                  -> addLogEntry(Transfer t)

Thus, in the context of the callerMethod transaction, the container must suspend the caller’s transaction, start a new transaction, update the account, commit, switch to the caller, pause, start a new one, renew the company, commit, return to the call, pause, start another one, add an entry into the logbook, record and return to the caller’s method, where, finally, complete the caller’s transaction.

And I was very surprised when it turned out that the slowest calls were from the @ Never-annotated caller method: it took 5.71 seconds to complete the 1000 calls described above for @Required → @Required, @Required → @RequiresNew 6.35 sec., but 9.05 sec. for @Never → @Not_Supported and 8.95 sec. for @Never → @Supports .

Is it good for @ Never-context to take so long? I mean, we don’t even have a transaction to pause and resume. Maybe there is some general knowledge about the @Never transaction attribute that I missed?

I am using Java EE 6, GlassFish 3, MySQL 5.1.69 InnoDB.

Thanks in advance.

+4
1

, .

. , ejb3.1 :

13.6.5 , " "

EJB , , . , ( ):

( )

(, JDBC).

+2

Source: https://habr.com/ru/post/1533792/


All Articles