eclipse / microprofile-context-propagation

Apache License 2.0
33 stars 23 forks source link

Spec needs to clarify what Application Context means #192

Closed Emily-Jiang closed 3 years ago

Emily-Jiang commented 4 years ago

From the conversation with @njr-11 , Application Context means the following:

From @njr-11

Application context includes the java:comp, java:module, and so forth JNDI namespace of the application component, as well as its thread context class loader.. Transaction context propagation means that the task or completion stage runs under the same transaction of the thread that submits the task or creates the stage. If the task or completion stage wants to roll back the transaction, it can do so with the usual rollback API, or it can mark the transaction for rollback with setRollbackOnly. The spec does not have anything where we auto-rollback due to a failure, which would limit flexibility of implementation by forcing rollback on exception paths. Transaction context propagation also covers propagation of the lack of any transaction to a thread. So if the original thread was not running in a transaction to start with, then the task or completion stage will also run without any active transaction on the thread.

@Ladicek states

That sounds nice, but isn't what the MP ConProp spec says, nor what its TCK tests. Specifically, the spec says that "it can determine the thread context class loader as well as the set of resource references that are available for lookup or resource injection", which is quite vague. The TCK test for the APPLICATION context doesn't test JNDI contexts at all (no wonder -- MicroProfile doesn't know anything about JNDI), and its test for the TCCL propagation doesn't really test anything. I'm aware of one MP ConProp implementation that fully passes the TCK, but doesn't propagate TCCL.

The spec doc needs to be updated to clearly specify the meaning.

Emily-Jiang commented 4 years ago

Can this issue be fixed in the upcoming release?