xaStart method

int xaStart({
  1. required int connectionId,
  2. required int formatId,
  3. required Uint8List gtrid,
  4. required Uint8List bqual,
})

xa_start: open a new XA branch on connectionId with the given XID components. Returns the xa_id on success, 0 on failure.

Implementation

int xaStart({
  required int connectionId,
  required int formatId,
  required Uint8List gtrid,
  required Uint8List bqual,
}) {
  final gtridPtr = _allocBytes(gtrid);
  final bqualPtr = _allocBytes(bqual);
  try {
    return _bindings.odbc_xa_start(
      connectionId,
      formatId,
      gtridPtr,
      gtrid.length,
      bqualPtr,
      bqual.length,
    );
  } finally {
    if (gtridPtr.address != 0) calloc.free(gtridPtr);
    if (bqualPtr.address != 0) calloc.free(bqualPtr);
  }
}