[MDEV-11067] CONNECT engine table_type=JDBC with ApacheInterface error Created: 2016-10-17 Updated: 2016-11-14 Resolved: 2016-10-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Connect |
| Affects Version/s: | 10.1.18 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Robert Dyas | Assignee: | Olivier Bertrand |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
centOS 7 |
||
| Description |
|
I have installed Apache DBCP 2 and the pooled library it requires. When I try to retrieve table names or column info with Wrapper=ApacheInterface everything works as it should. I can CREATE a connect table with Wrapper=ApacheInterface
It is on the class path because its in the java ext folder. ApacheInterface.class is in a jar file in the ext folder also. Not sure if I'm doing something wrong or if its a bug of some sort? |
| Comments |
| Comment by Robert Dyas [ 2016-10-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Additional info that might help... If I start the server and the first access to the remote server is via ApacheInterface, this is the error message I get:
However if I first access the remote server via JdbcInterface (which works correctly) then try the ApacheInterface I get this error message:
Please let me know if there is any additional info I can provide. Thank you. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2016-10-19 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I cannot reproduce it on Windows. I start the session by:
Then access some pre-defined tables:
or:
To morrow I'll try it on Linux ubuntu | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Robert Dyas [ 2016-10-19 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I was not aware that the commons-logging was required. I had commons-dbcp2 and commons-pool2 but not the commons-logging... and the tell tale class name was cut off in the error message. Once I added commons-logging to the classpath it worked perfectly Unless I missed it, maybe you can update the documentation to state that ApacheInterface needs 3 libs: Also, how do I configure the connection pool without writing a custom ApacheInterface class? On to stress testing, then onto pilot testing. Zero crashes so far (very unlike the ODBC experience where a bad driver interactions could take down the entire MariaDB server - has not happened once yet with JDBC... just a nice mostly clean error message). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2016-10-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
how do I configure the connection pool without writing a custom ApacheInterface class? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Robert Dyas [ 2016-10-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
looking at the 2.1.1 BasicDataSource api docs: Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is not the only way to combine the commons-dbcp and commons-pool packages, but provides a "one stop shopping" solution for basic requirements.
I'm not sure but maybe this is the answer? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2016-10-22 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
From what I understand setConnectionProperties is not used to configure the basicDataSource itself but to send property settings to the driver used by the connection. I have tried a test by enabling settings connection properties via a new create option, for example:
The property list (here maxRows=5;useSSL=false) is passed to the ApacheInterface as a fifth parameter and when it is not null, is used as the parameter of setConnectionProperties that send them to the MySQL driver.
Unlike the first solution, this one works as well with the Apache or MySQL wrappers. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Robert Dyas [ 2016-10-26 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I agree, don't implement as its redundant. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2016-10-26 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I have updated the documentation to indicate precisely what jar files are needed when using the Apache interface. |