Look at Delegating Translators at https://docs.jboss.org/author/display/TEIID/Built-in+Translators
That should give you a interception point before the translator can execute the call. You would need to write your own Delegating translator for this.
Thank you for your prompt response.
I understand the usage of the Delegating translator and the overall approach of using the Delegating Translator. But that is not what I am trying to do.
In the method createUpdateExecution of the ExecutionFactory, at the point of execution of the body of the method, if the method body is already in a transaction, I want to get access to the transaction manager, transaction context and the transaction itself, how do I get hold of these ?
Typically in a container, we look up for the transaction manager using the jndi lookup using the initialContext. what is the equivalent of that ? Hope I am clear.
We do not currently provide a reference to the TransactionManager nor our internal transaction context via our apis. We obtain the JBoss AS transaction context via a AS service lookup. You'd have to check in the AS docs if it's also available via JNDI. You can obtain the Transaction object from the TransactionManager then. What transaction context are you interested in Teiid's or the JCA?
However we typically think of transaction responsibilities falling on the JCA layer via a resource adapter.
Thank you for your response.
I could get the TransactionManager using a JNDI lookup and from there I could get the current Transaction. However I am not familiar with the AS service lookup approach ? I will give that a try.
How do I get hold of the TransactionMetaData instance? Can you point me to a specific example of its usage or any pointers to the approach ?
The TransactionMetaData is currently just used for reporting. You are not expected to need to interact with it on the server side. Again the expecation is that transactional concerns would be handled through JCA given by exposing an XAResource. There is nothing that prevents from using the thread bound transaction as you are though.