-
1. Re: How to get the current transaction, transaction manager at the execution factory's executions ?
rareddy Oct 23, 2012 11:58 AM (in response to sivajd)Siva,
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.
Ramesh..
-
2. Re: How to get the current transaction, transaction manager at the execution factory's executions ?
sivajd Oct 23, 2012 12:45 PM (in response to rareddy)Ramesh,
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.
Thanks
Siva
-
3. Re: How to get the current transaction, transaction manager at the execution factory's executions ?
shawkins Oct 23, 2012 12:56 PM (in response to rareddy)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.
-
4. Re: How to get the current transaction, transaction manager at the execution factory's executions ?
sivajd Oct 23, 2012 1:29 PM (in response to shawkins)Steven,
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 ?
Thanks
Siva
-
5. Re: How to get the current transaction, transaction manager at the execution factory's executions ?
shawkins Oct 23, 2012 1:52 PM (in response to sivajd)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.
Steve