use<R> method

R use<R>(
  1. R action(
    1. T
    )
)

Use the resource with automatic cleanup

Implementation

R use<R>(R Function(T) action) {
  if (_disposed) {
    throw OracleMemoryException('Resource has already been disposed');
  }

  try {
    return action(resource);
  } finally {
    dispose();
  }
}