return this; if (that.isAutoCommit() != null && this.autoCommit != that.isAutoCommit()) { this.autoCommit = that.isAutoCommit(); this.isDirty = true; if (that.isReadOnly() != null && this.readOnly != that.isReadOnly()) { this.readOnly = that.isReadOnly(); this.isDirty = true; if (that.getTransactionIsolation() != null && !that.getTransactionIsolation().equals(this.transactionIsolation)) { this.transactionIsolation = that.getTransactionIsolation(); this.isDirty = true; if (that.getCatalog() != null && !that.getCatalog().equalsIgnoreCase(this.catalog)) { this.catalog = that.getCatalog(); this.isDirty = true; if (that.getSchema() != null && !that.getSchema().equalsIgnoreCase(this.schema)) { this.schema = that.getSchema(); this.isDirty = true;
public ConnectionProperties call() { ConnectionPropertiesImpl localProps = propsMap.get(ch.id); if (localProps == null) { localProps = new ConnectionPropertiesImpl(); localProps.setDirty(true); propsMap.put(ch.id, localProps); } // Only make an RPC if necessary. RPC is necessary when we have local changes that need // flushed to the server (be sure to introduce any new changes from connProps before // checking AND when connProps.isEmpty() (meaning, this was a request for a value, not // overriding a value). Otherwise, accumulate the change locally and return immediately. if (localProps.merge(connProps).isDirty() && connProps.isEmpty()) { final Service.ConnectionSyncResponse response = service.apply( new Service.ConnectionSyncRequest(ch.id, localProps)); propsMap.put(ch.id, (ConnectionPropertiesImpl) response.connProps); return response.connProps; } else { return localProps; } } });
return this; if (that.isAutoCommit() != null && this.autoCommit != that.isAutoCommit()) { this.autoCommit = that.isAutoCommit(); this.isDirty = true; if (that.isReadOnly() != null && this.readOnly != that.isReadOnly()) { this.readOnly = that.isReadOnly(); this.isDirty = true; if (that.getTransactionIsolation() != null && !that.getTransactionIsolation().equals(this.transactionIsolation)) { this.transactionIsolation = that.getTransactionIsolation(); this.isDirty = true; if (that.getCatalog() != null && !that.getCatalog().equalsIgnoreCase(this.catalog)) { this.catalog = that.getCatalog(); this.isDirty = true; if (that.getSchema() != null && !that.getSchema().equalsIgnoreCase(this.schema)) { this.schema = that.getSchema(); this.isDirty = true;
return this; if (that.isAutoCommit() != null && this.autoCommit != that.isAutoCommit()) { this.autoCommit = that.isAutoCommit(); this.isDirty = true; if (that.isReadOnly() != null && this.readOnly != that.isReadOnly()) { this.readOnly = that.isReadOnly(); this.isDirty = true; if (that.getTransactionIsolation() != null && !that.getTransactionIsolation().equals(this.transactionIsolation)) { this.transactionIsolation = that.getTransactionIsolation(); this.isDirty = true; if (that.getCatalog() != null && !that.getCatalog().equalsIgnoreCase(this.catalog)) { this.catalog = that.getCatalog(); this.isDirty = true; if (that.getSchema() != null && !that.getSchema().equalsIgnoreCase(this.schema)) { this.schema = that.getSchema(); this.isDirty = true;
public ConnectionProperties call() { ConnectionPropertiesImpl localProps = propsMap.get(ch.id); if (localProps == null) { localProps = new ConnectionPropertiesImpl(); localProps.setDirty(true); propsMap.put(ch.id, localProps); } // Only make an RPC if necessary. RPC is necessary when we have local changes that need // flushed to the server (be sure to introduce any new changes from connProps before // checking AND when connProps.isEmpty() (meaning, this was a request for a value, not // overriding a value). Otherwise, accumulate the change locally and return immediately. if (localProps.merge(connProps).isDirty() && connProps.isEmpty()) { final Service.ConnectionSyncResponse response = service.apply( new Service.ConnectionSyncRequest(ch.id, localProps)); propsMap.put(ch.id, (ConnectionPropertiesImpl) response.connProps); return response.connProps; } else { return localProps; } } });
public ConnectionProperties call() { ConnectionPropertiesImpl localProps = propsMap.get(ch.id); if (localProps == null) { localProps = new ConnectionPropertiesImpl(); localProps.setDirty(true); propsMap.put(ch.id, localProps); } // Only make an RPC if necessary. RPC is necessary when we have local changes that need // flushed to the server (be sure to introduce any new changes from connProps before // checking AND when connProps.isEmpty() (meaning, this was a request for a value, not // overriding a value). Otherwise, accumulate the change locally and return immediately. if (localProps.merge(connProps).isDirty() && connProps.isEmpty()) { final Service.ConnectionSyncResponse response = service.apply( new Service.ConnectionSyncRequest(ch.id, localProps)); propsMap.put(ch.id, (ConnectionPropertiesImpl) response.connProps); return response.connProps; } else { return localProps; } } });
protected void apply(Connection conn, ConnectionProperties connProps) throws SQLException { if (connProps.isAutoCommit() != null) { conn.setAutoCommit(connProps.isAutoCommit()); } if (connProps.isReadOnly() != null) { conn.setReadOnly(connProps.isReadOnly()); } if (connProps.getTransactionIsolation() != null) { conn.setTransactionIsolation(connProps.getTransactionIsolation()); } if (connProps.getCatalog() != null) { conn.setCatalog(connProps.getCatalog()); } if (connProps.getSchema() != null) { conn.setSchema(connProps.getSchema()); } }
protected void apply(Connection conn, ConnectionProperties connProps) throws SQLException { if (connProps.isAutoCommit() != null) { conn.setAutoCommit(connProps.isAutoCommit()); } if (connProps.isReadOnly() != null) { conn.setReadOnly(connProps.isReadOnly()); } if (connProps.getTransactionIsolation() != null) { conn.setTransactionIsolation(connProps.getTransactionIsolation()); } if (connProps.getCatalog() != null) { conn.setCatalog(connProps.getCatalog()); } if (connProps.getSchema() != null) { conn.setSchema(connProps.getSchema()); } }
public boolean isReadOnly() throws SQLException { checkOpen(); return unbox(sync().isReadOnly(), true); }
public String getCatalog() throws SQLException { checkOpen(); return sync().getCatalog(); }
public int getTransactionIsolation() throws SQLException { checkOpen(); //noinspection MagicConstant return unbox(sync().getTransactionIsolation(), TRANSACTION_NONE); }
public String getSchema() { return sync().getSchema(); }
public String getCatalog() { return sync().getCatalog(); }
@Override Responses.ConnectionSyncResponse serialize() { Responses.ConnectionSyncResponse.Builder builder = Responses.ConnectionSyncResponse .newBuilder(); if (null != connProps) { builder.setConnProps(connProps.toProto()); } if (null != rpcMetadata) { builder.setMetadata(rpcMetadata.serialize()); } return builder.build(); }
public int getTransactionIsolation() throws SQLException { checkOpen(); //noinspection MagicConstant return unbox(sync().getTransactionIsolation(), TRANSACTION_NONE); }
public String getSchema() throws SQLException { checkOpen(); return sync().getSchema(); }
public boolean getAutoCommit() throws SQLException { checkOpen(); return unbox(sync().isAutoCommit(), true); }
public boolean isReadOnly() throws SQLException { checkOpen(); return unbox(sync().isReadOnly(), true); }
public CalciteMetaImpl(CalciteConnectionImpl connection) { super(connection); this.connProps .setAutoCommit(false) .setReadOnly(false) .setTransactionIsolation(Connection.TRANSACTION_NONE); this.connProps.setDirty(false); }
public CalciteMetaImpl(CalciteConnectionImpl connection) { super(connection); this.connProps .setAutoCommit(false) .setReadOnly(false) .setTransactionIsolation(Connection.TRANSACTION_NONE); this.connProps.setDirty(false); }