the problem is that normal scopes (such as
@TransactionScoped) are associated with the current thread and usually don't propagate. In your case, it's JTA impl which provides the CDI context. So I would probably start with finding out when
StreamingOutput#write()is invoked and read the JTA spec to find details about when the transaction context is active (and whether it propagates, i.e. if it can be associated with more threads).