Is the EJB obtaining a connection, or is this caused by pool pre-population? If it's the latter, then set the min pool size to 0.
If the EJB layer still has issues with inactive connections, then we probably want to consider adding a connection option to make the connection blocking until active.
JPA entity mappings are validated with datasource by obtaining a connections on deployment , I have tested my setting the pool size to 0, which has no effect. Can a dependency configuration be made using jboss-dependencies.xml or jboss-deployment.xml?
1 of 1 people found this helpful
The VDBDeployer is hard-coded to use a relative deployment order of 3001, which is after the data sources are loaded. jboss-dependency.xml may be of some help, however there is no service/bean representing the active state of a VDB. It seems like an enhancement will be required.
If the service/bean representation for the VDB state is not available then jboss-dependencies.xml would not help for dynamic vdb deployment scenario. It does seem like a enhancement. Thanks for sharing the thoughts. Please update if found some way.I will do the same from my end, thanks again
One workaround is deploying the Teiid Dynamic VDB in a separate JBoss AS instance than same instance EJB in.
The dependecy stuff you could possibly do it in the Teiid 8.0 with JBoss AS 7.1.1. In 7.7 changing the deployment order after EJB deployment number may work?
If I understand correctly, we have a similar need: Our application's VDB relies on subordinate VDBs to obtain structural information that gets processed in our app's translator's getMetadata method. Therefore, the application VDB should not start until the subordinate VDB is ready.
Currently, the application VDB polls the subordinate VDB waiting for it to be ready. Our application also dynamically produces VDBs using Teiid's admin API so a JBoss beans notification would be cumbersome. A callback mechanism from the Admin api would be preferable.
If this makes sense, I'll submit a jira
Admin interface can *not* be used with push model. It is pull only. This is based on JBoss AS profile services.
For 7.7 the simplest enhancement would be to just add optional vdb polling into the JDBC connection logic, unless Ramesh you know of some other AS tricks we could employ.
For 8.1 it would probably make sense to rethink the whole status active/inactive logic. It was a fairly clean concept back in the MMX days, however now it is inconsistent as datasources can be removed indepenently of consuming vdbs. So transitioning to the inactive state is meaningless to connections that have already been made.
I would propose using the statuses:
INVALID - if there is a metadata validation failure or a source missing
We would also change the logic to not inhibit making a connection regardless of the status. The DQP getMetadata and executeRequest calls are the only ones that would need to enforce that the vdb is out of the loading state before proceeding. To make this work as an asynch callback getMetadata would also need to return a Future and the work on those would delayed until a vdblifecyclelistener reports that the target vdb has finished loading.
As long as the engine is running and the vdb is deployed, then client connections will succeed. The question would then be for local jndi connections how do we wait until the vdb is deployed. Ramesh is there a simply way in the AS to have a DataSource dependent upon a VDBService?
All I was thinking is checking out the EJB deployer's deployment order and make VDB deployment order after it, do not know if that is sufficient.
I do not think we can create a dependency on foreign services, you can only listen to their events.
*We* don't need a solution for the 7.7 line. We're basing our next release off of the 8.x line.
If I understand the implication of making the loading async (using futures), then the VDBs are immediately available and clients could use standard JDBC timeout methods to control how long to wait before the VDB ultimately becomes ready. That is a nice consequence.
For local JNDI connections, with every data source there is implicit service gets created in the AS7. Since they are in same JVM, solution is to place a listener on this service and only grant the connection at that point or timeout.