Hi,
If connection.getMetaData.supportsTransactions is false, we need to disallow
setAutoCommit and give appropriate exception?
Using hsqldb in mem connection with calcite Jdbc adapter, I did the following
test:
final String url = "jdbc:hsqldb:mem:.";
Properties info = new Properties();
info.put("model",
"inline:"
+ "{\n"
+ " version: '1.0',\n"
+ " defaultSchema: 'BASEJDBC',\n"
+ " schemas: [\n"
+ " {\n"
+ " type: 'jdbc',\n"
+ " name: 'BASEJDBC',\n"
+ " jdbcDriver: '" + org.hsqldb.jdbcDriver.class.getName() +
"',\n"
+ " jdbcUrl: '" + url + "',\n"
+ " jdbcCatalog: null,\n"
+ " jdbcSchema: null\n"
+ " }\n"
+ " ]\n"
+ "}");
final Connection connection = DriverManager.getConnection("jdbc:calcite:",
info);
System.out.println("connection.getMetaData.supportsTransactions: " +
connection.getMetaData().supportsTransactions());
System.out.println("connection.getAutoCommit before: " +
connection.getAutoCommit());
connection.setAutoCommit(true);
System.out.println("connection.getAutoCommit after: " +
connection.getAutoCommit());
Result in console:
connection.getMetaData.supportsTransactions: false
connection.getAutoCommit before: false
connection.getAutoCommit after: true
Thanks & Regards,
Yuri Au Yong
Software Engineer - NPM | [email protected] | Desk: +60 3 7663 8372
Persistent Systems Ltd. | Partners in Innovation |
www.persistentsys.com<http://www.persistentsys.com/>
[sign1]<https://tnpmsupport.persistentsys.com/training>
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the
property of Persistent Systems Ltd. It is intended only for the use of the
individual or entity to which it is addressed. If you are not the intended
recipient, you are not authorized to read, retain, copy, print, distribute or
use this message. If you have received this communication in error, please
notify the sender and delete all copies of this message. Persistent Systems
Ltd. does not accept any liability for virus infected mails.