-
1. Re: Teiid embedded reconnect when a physical model is restarted
rareddy Oct 12, 2016 9:21 AM (in response to hend.amin)Did you mean your JDBC connection to Teiid instance is terminated. If that is the case take look at "autoFailover=true" flag on the JDBC URL for automatic connection. See Driver Connection · Teiid Documentation
-
2. Re: Teiid embedded reconnect when a physical model is restarted
hend.amin Oct 13, 2016 3:43 AM (in response to rareddy)Hello Ramesh
No i meant that the connection from teiid intance to the datamodel is terminated/closed. and it stays closed even if the physical model/datasource is started again.
-
3. Re: Teiid embedded reconnect when a physical model is restarted
rareddy Oct 13, 2016 11:08 AM (in response to hend.amin)If you can provide small test case we can see what is going on? In embedded scenarios the developer is writing the code to create connections to sources.
-
4. Re: Teiid embedded reconnect when a physical model is restarted
hend.amin Oct 19, 2016 4:06 AM (in response to rareddy)for example i have an embedded Teiid server running
the teiid server has a VDB deployed, the VDB has a physical model that is an oracle DB.
The oracle DB is running and the server is connected to it.
After sometime i stop the oracle DB but i keep the server running. I can connect to the server using squirrel but when i run a query i get an exception (because the DB is stopped).
When i start the DB again and i try to run a query on teiid using squirrel i still get the exception although the oracle DB is started again. I want Teiid to reconnect automatically to the DB when it is restart again. I do not want to restart the teiid server when the DB is started again.
Is there a way to do that for the embedded Teiid server ??
-
5. Re: Teiid embedded reconnect when a physical model is restarted
rareddy Oct 23, 2016 9:26 PM (in response to hend.amin)As mentioned above, in the embedded, yo as the developer is providing the "Connection Factory" class to create the connection to Oracle. So, in effect Connection Factory is pool, so you need to make sure that you always return the valid connection to Teiid.
If you use Teiid Server (not embedded) it uses a connection pool, and you can set configuration parameters to make sure connection is valid before giving to Teiid, you need to mimic the same behavior in your code.