0

if I specify @TransactionAttribute on a class, but I do NOT specify @stateless or @stateful, what is the behavior ? Will this be a session bean, or will the @TransactionAttribute just be ignored. ??

@Stateless
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class PhotosServiceImpl implements PhotosService

vs

@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class PhotosServiceImpl implements PhotosService 
klind
  • 855
  • 2
  • 21
  • 33

1 Answers1

0

Without @Stateless you can't inject it into other EJBs. If you instantiate it without doing injection, TransactionAttribute wouldn't kick in anyway.

So yes, TransactionAttribute on a non EJB class will have no effect.

Tea Curran
  • 2,923
  • 2
  • 18
  • 22