public override byte[] GetSlice(int sliceLength) { // Clear the status vector ClearStatusVector(); int dbHandle = _db.Handle; int trHandle = _transaction.Handle; ArrayDescMarshaler marshaler = ArrayDescMarshaler.Instance; IntPtr arrayDesc = marshaler.MarshalManagedToNative(Descriptor); byte[] buffer = new byte[sliceLength]; _db.FbClient.isc_array_get_slice( _statusVector, ref dbHandle, ref trHandle, ref _handle, arrayDesc, buffer, ref sliceLength); // Free memory marshaler.CleanUpNativeData(ref arrayDesc); FesConnection.ParseStatusVector(_statusVector, _db.Charset); return(buffer); }
private void ParseStatusVector(IntPtr[] statusVector) { IscException ex = FesConnection.ParseStatusVector(statusVector, _charset); if (ex != null && !ex.IsWarning) { throw ex; } }
public void CancelOperation(int kind) { int dbHandle = Handle; IntPtr[] localStatusVector = new IntPtr[IscCodes.ISC_STATUS_LENGTH]; _fbClient.fb_cancel_operation(localStatusVector, ref dbHandle, kind); FesConnection.ParseStatusVector(localStatusVector, _charset); }
protected override void Cancel() { lock (this.db) { // Clear the status vector this.ClearStatusVector(); db.FbClient.isc_cancel_blob(this.statusVector, ref this.blobHandle); FesConnection.ParseStatusVector(this.statusVector, this.db.Charset); } }
protected override void Cancel() { lock (_db) { // Clear the status vector ClearStatusVector(); _db.FbClient.isc_cancel_blob(_statusVector, ref _blobHandle); FesConnection.ParseStatusVector(_statusVector, _db.Charset); } }
internal void ProcessStatusVector(IntPtr[] statusVector) { var ex = FesConnection.ParseStatusVector(statusVector, Charset); if (ex != null) { if (ex.IsWarning) { WarningMessage?.Invoke(ex); } else { throw ex; } } }
protected override void PutSegment(byte[] buffer) { lock (this.db) { // Clear the status vector this.ClearStatusVector(); db.FbClient.isc_put_segment( this.statusVector, ref this.blobHandle, (short)buffer.Length, buffer); FesConnection.ParseStatusVector(this.statusVector, this.db.Charset); } }
internal void ParseStatusVector(IntPtr[] statusVector) { IscException ex = FesConnection.ParseStatusVector(statusVector, _charset); if (ex != null) { if (ex.IsWarning) { _warningMessage(ex); } else { throw ex; } } }
private void ProcessStatusVector(IntPtr[] statusVector) { IscException ex = FesConnection.ParseStatusVector(statusVector, _charset); if (ex != null) { if (ex.IsWarning) { #warning This is not propagated to FesDatabase's callback as with GdsDatabase //_warningMessage?.Invoke(ex); } else { throw ex; } } }
public void Detach() { lock (this) { if (TransactionCount > 0) { throw new IscException(IscCodes.isc_open_trans, TransactionCount); } int dbHandle = Handle; // Clear status vector ClearStatusVector(); _fbClient.isc_detach_database(_statusVector, ref dbHandle); _handle = dbHandle; FesConnection.ParseStatusVector(_statusVector, _charset); } }
public void Detach() { lock (this) { if (this.TransactionCount > 0) { throw new IscException(IscCodes.isc_open_trans, this.TransactionCount); } int dbHandle = this.Handle; // Clear status vector this.ClearStatusVector(); fbClient.isc_detach_database(this.statusVector, ref dbHandle); this.handle = dbHandle; FesConnection.ParseStatusVector(this.statusVector, this.charset); } }
public override void PutSlice(System.Array sourceArray, int sliceLength) { // Clear the status vector ClearStatusVector(); int dbHandle = _db.Handle; int trHandle = _transaction.Handle; ArrayDescMarshaler marshaler = ArrayDescMarshaler.Instance; IntPtr arrayDesc = marshaler.MarshalManagedToNative(Descriptor); // Obtain the System of type of Array elements and // Fill buffer Type systemType = GetSystemType(); byte[] buffer = new byte[sliceLength]; if (systemType.IsPrimitive) { Buffer.BlockCopy(sourceArray, 0, buffer, 0, buffer.Length); } else { buffer = EncodeSlice(Descriptor, sourceArray, sliceLength); } _db.FbClient.isc_array_put_slice( _statusVector, ref dbHandle, ref trHandle, ref _handle, arrayDesc, buffer, ref sliceLength); // Free memory marshaler.CleanUpNativeData(ref arrayDesc); FesConnection.ParseStatusVector(_statusVector, _db.Charset); }
protected override void Open() { lock (this.db) { // Clear the status vector this.ClearStatusVector(); int dbHandle = this.db.Handle; int trHandle = this.transaction.Handle; db.FbClient.isc_open_blob2( this.statusVector, ref dbHandle, ref trHandle, ref this.blobHandle, ref this.blobId, 0, new byte[0]); FesConnection.ParseStatusVector(this.statusVector, this.db.Charset); } }
protected override void Open() { lock (_db) { // Clear the status vector ClearStatusVector(); int dbHandle = _db.Handle; int trHandle = _transaction.Handle; _db.FbClient.isc_open_blob2( _statusVector, ref dbHandle, ref trHandle, ref _blobHandle, ref _blobId, 0, new byte[0]); FesConnection.ParseStatusVector(_statusVector, _db.Charset); } }
protected override void Create() { lock (this.db) { // Clear the status vector this.ClearStatusVector(); int dbHandle = this.db.Handle; int trHandle = this.transaction.Handle; db.FbClient.isc_create_blob2( this.statusVector, ref dbHandle, ref trHandle, ref this.blobHandle, ref this.blobId, 0, new byte[0]); FesConnection.ParseStatusVector(this.statusVector, this.db.Charset); this.RblAddValue(IscCodes.RBL_create); } }