sql icon indicating copy to clipboard operation
sql copied to clipboard

JDBC Driver does not support disabling auto-commit?

Open davide-malagoli opened this issue 6 years ago • 7 comments

Hello,

I just looked at the code because I had a problem using your driver with TIBCO Jasper Server PRO, and I noticed that the problem was caused by an exception thrown when the program attemps to disable autocommit.

I was using this guide,the error is the following

jdbc_error

There's no plan to support it in the future?

Thank in advance

davide-malagoli avatar Mar 23 '20 17:03 davide-malagoli

Thanks for reporting. We will take a look.

abbashus avatar Mar 23 '20 18:03 abbashus

Is it possible to provide any relevant logs generated from JDBC driver?

abbashus avatar Mar 23 '20 18:03 abbashus

@davide-malagoli , does the topic in here help https://discuss.opendistrocommunity.dev/t/opendistro-sql-jdbc-driver/2265

Have u try to include the username and password?

penghuo avatar Mar 24 '20 03:03 penghuo

No, it does not help. I removed username and password from the screeshot for security reasons. During the test they were set. The only way I solved the problem was creating a JNDI datasource on the Tomcat side, enabling auto-commit, and let Jasper use that JNDI

davide-malagoli avatar Mar 27 '20 16:03 davide-malagoli

I have the same issue, using Vaadin (SQLContainer, tries to disable autoCommit, which isn't supported by this driver). Is it expected to be resolved soon?

squatbetty avatar Jul 25 '20 11:07 squatbetty

Any chance this will be added?

squatbetty avatar Apr 02 '21 21:04 squatbetty

@squatbetty Sorry for the late response! As I understand, when auto-commit disabled, that means all queries followed need to be executed in a transaction. This is not supported in Elasticsearch. The throwing exception code in our JDBC driver can be replaced by doing nothing, though I'm not sure what's the impact on your application.

If you want, you can try it out and build a new JDBC jar file to verify. Thanks!

https://github.com/opendistro-for-elasticsearch/sql/blob/develop/sql-jdbc/src/main/java/com/amazon/opendistroforelasticsearch/jdbc/ConnectionImpl.java#L150

dai-chen avatar Apr 02 '21 23:04 dai-chen