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.
close() is then called on every Execution created, unless there is an abnormal shutdown.
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.
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.
My payload is a simple username and password.
Is this userid/password same as the user who is logging into the JDBC layer?