lowka commented on code in PR #6654: URL: https://github.com/apache/ignite-3/pull/6654#discussion_r2387734544
########## modules/jdbc/src/main/java/org/apache/ignite/internal/jdbc2/JdbcConnection2.java: ########## @@ -0,0 +1,696 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.jdbc2; + +import static java.sql.ResultSet.CONCUR_READ_ONLY; +import static java.sql.ResultSet.HOLD_CURSORS_OVER_COMMIT; +import static java.sql.ResultSet.TYPE_FORWARD_ONLY; +import static org.apache.ignite.internal.jdbc.proto.SqlStateCode.CONNECTION_CLOSED; + +import java.sql.Array; +import java.sql.Blob; +import java.sql.CallableStatement; +import java.sql.Clob; +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.NClob; +import java.sql.PreparedStatement; +import java.sql.SQLClientInfoException; +import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; +import java.sql.SQLWarning; +import java.sql.SQLXML; +import java.sql.Savepoint; +import java.sql.ShardingKey; +import java.sql.Statement; +import java.sql.Struct; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.Properties; +import java.util.concurrent.Executor; +import org.apache.ignite.client.IgniteClient; +import org.apache.ignite.internal.jdbc.ConnectionProperties; +import org.apache.ignite.internal.jdbc.JdbcDatabaseMetadata; +import org.apache.ignite.internal.jdbc.proto.JdbcQueryEventHandler; +import org.apache.ignite.internal.jdbc.proto.SqlStateCode; +import org.apache.ignite.internal.lang.IgniteExceptionMapperUtil; +import org.apache.ignite.internal.sql.SqlCommon; +import org.apache.ignite.lang.util.IgniteNameUtils; +import org.jetbrains.annotations.Nullable; + +/** + * {@link Connection} implementation backed by the thin client. + */ +public class JdbcConnection2 implements Connection { + + private final IgniteClient client; + + private final JdbcDatabaseMetadata metadata; + + private String schemaName; + + private volatile boolean closed; + + private int txIsolation; + + private boolean autoCommit; + + private boolean readOnly; + + private int networkTimeoutMillis; + + /** + * Creates new connection. + * + * @param client Client. + * @param eventHandler Event handler. + * @param props Connection properties. + */ + public JdbcConnection2( + IgniteClient client, + JdbcQueryEventHandler eventHandler, + ConnectionProperties props + ) throws SQLException { + autoCommit = true; + + networkTimeoutMillis = props.getConnectionTimeout(); + txIsolation = TRANSACTION_NONE; Review Comment: Thanks. Fixed setTransaction as well as it should not accept TRANSACTION_NONE. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
