Is it ok to use @Transactional with EJBs? Is there any difference between using @TransactionAttribute?
I found already here Difference between @Transactional and @TransactionAttribute that @Transactional is for POJO. I've used it accidently for EJB in Wildfly and there were no errors. I wonder whether the behaviour would be the same or if there are some differences. Or maybe @Transactional would be just ignored and default level of @TransactionAttribute would be used? I've search in the spec but found nothing helpful.
EDIT:
As @kostja suggested it's not clear to what framework question is referred to. I meant @Transactional from CDI, not Spring.
No. Per section 7.1 of the EJB 3.2 specification:
From a container implementation perspective, CDI and EJB operate at different layers (the CDI proxy wraps the EJB proxy). In order to make this work nicely, there would need to be deeper integration between the two containers so that the
@Transactional
interceptor and EJB container don't both attempt to check/update the transaction context.