-
1. Which method gets called before the translator exits
rareddy Mar 14, 2011 10:05 AM (in response to rakeshsagar)Rakesh,
After creating a "Execution" object, the "execute" method is called. The best way for you to see is reading the code or running a debugger.
Hope this helps.
Ramesh..
-
2. Which method gets called before the translator exits
shawkins Mar 14, 2011 10:39 AM (in response to rareddy)close() is then called on every Execution created, unless there is an abnormal shutdown.
Steve
-
3. Which method gets called before the translator exits
rakeshsagar Mar 16, 2011 9:43 AM (in response to rakeshsagar)Hi all,
Thanks for your replies.
The situation is that I had extended DB2ExecutionFactory and overloaded the getConnection() and createExecution() methods.
The order of the execution is getconnection() gets called first and then the createExecution() gets called.
My requirement is that since we get the payload information in the ExecutionContext of createExecution(), I want to create a connection to DB2 using the credentials retrieved from the payload.
Is there any method by which we can make the createExecution() to be called first and in the createExecution() call the getConnection().
The default invocation of getConnection() method can be supressed i.e in this case there will be no need for us to call the getConnection().
Please help me in this.
Thanks
Rakesh.
-
4. Which method gets called before the translator exits
rareddy Mar 16, 2011 11:32 AM (in response to rakeshsagar)Rakesh,
I know what you are trying to achieve. Is your payload is a simple userid/password? or something more?
Have you seen the document on this as to how Teiid solves this issue? http://docs.jboss.org/teiid/7.3.0.Final/admin-guide/en-US/html_single/#d0e522
If the above does not solve your issue, you can write your own "Login Module". Take a look at http://anonsvn.jboss.org/repos/teiid/trunk/jboss-integration/src/main/java/org/teiid/jboss/RoleBasedCredentialMapIdentityLoginModule.java
for sample. This is correct way to introduce a payload at data source. However, there is no way to pass the needed credentails from the JDBC login into Teiid.
You can do what you are doing but, you are circumventing the connection pool, and managing the connection yourself. you would have to compensate for transactional operations, configuration etc. Also Translator != Resource Adaptor (the connection module). The calling sequence of ExecutionFactory is set and can NOT be changed.
As you said you can stub the "getConnection" and create connection when "createExecution" is called, however you must close the connection when the execution is finished, otherwise you will have lots of open connections.
Hope this helps.
Ramesh..
-
5. Which method gets called before the translator exits
rakeshsagar Mar 17, 2011 3:05 AM (in response to rareddy)My payload is a simple username and password.
-
6. Which method gets called before the translator exits
rareddy Mar 17, 2011 2:20 PM (in response to rakeshsagar)Is this userid/password same as the user who is logging into the JDBC layer?