There are configuration options on the data source that can be used. Example from the Teiid data source doc's:
<datasource jndi-name="java:/mysql-ds" pool-name="mysqlDS">
There are also options for the connection pool to check the connection before handing it out.
For more detail on configuration, goto: https://docs.jboss.org/author/display/WFLY9/DataSource+configuration
thanks for your hints. In the DS I already tried to check the flush-strategy options, through the teiid web admin console.
At first, it was empty (default should be FailingConnectionOnly).
I edited the DS specifying all possible values, FailingConnectionOnly, IdleConnections and EntirePool, but it seemed to make no difference in reconnection behaviour from the Client: I'll try again, anyway.
About the second link, I'll check, and try to figure out what can be done... feel free to suggest what traces/logs to check to get what is cousing this issue...
edit: I tried also to kikk the MSSQL connectin from its source server, and as in the MYSQL case, teiid can't reconnect, until I click "flush" in the DS pool area....
where can I learn what exactly "flush" does, and maybe how to force an automatic flush periodically...?
use ping SQL to check the connection like below
<check-valid-connection-sql> select * from duel </check-valid-connection-sql>
I just tried like this, but now even flush does not work.... here is the DS taken from the XML file as it is now...
(edit: now the sql checker is "select 1 from DUAL", but again as before it reconnects only after manual flush )
<datasource jta="true" jndi-name="java:/testmysql" pool-name="testmysql" enabled="true" use-ccm="true" statistics-enabled="false">
<check-valid-connection-sql>select 1 from DUAL</check-valid-connection-sql>
"Select * from Dual" was meant to be as an example, you need to find right test SQL for database in question. Some examples are here
I tried a few working queries... but every time, if I kill the conection from the real backend server, teiid does not restart a connection until I manually flush...
before manually flushing, i get in the client errors like
"Error: TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 mysql5-connector: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values:  SQL: SELECT g_0.`conto` AS c_0, g_0.`descrizione` AS c_1, g_0.`split_fornitori` AS c_2, g_0.`ivaind` AS c_3, g_0.`attivo` AS c_4 FROM `fred`.`conti_ripartizioni` AS g_0 LIMIT 100]
SQLState: 50000 ErrorCode: 30504"
then if I manually flush, everything magically works again...
I need to solve this, and at least temporarily find a workaround, like a cronjob to flush datasources, until I get/solve why it fails..
You need validate on match or background validation to be true:
Then it should issue the validation sql. You can also use:
Rather than specifying the test query.
Thanks, Steven. Our company is closed for holidays until january 10, (we work in the learning/training field).
I'll test your (precious) hints only then but for now I wish say thank you . I really hope 2016 will be our "Teiid" year.
Yes! This triggers the connection restart at client request... Thanks, now I'll explore all other parameters...
Thank you very much for supporting my newbieness....