Error retrieving connections in jboss to multiple databases even though there is no transaction

后端 未结 2 1610
天涯浪人
天涯浪人 2021-01-01 21:45

We are in the process of upgrading from JBoss 6 to JBoss 7. The nature of our application has a separate database instance per customer, as well as a core configuration data

2条回答
  •  太阳男子
    2021-01-01 22:00

    OK, it turns out that unlike JBoss6, a NOT_SUPPORTED transaction is still a transaction as far as the validation logic for retrieving data sources is concerned.

    The way to work around this is to make the whole EJB a bean managed transaction:

    @TransactionManagement(TransactionManagementType.BEAN)
    

    This unfortunately limits some flexibility in that some times you would rather control this method-by-method, but it isn't too painful a workaround.

提交回复
热议问题