Skip to main content
added 353 characters in body
Source Link
helb
  • 552
  • 3
  • 14

Regarding atomicity, the documentation does not explicitly say so but the CheckOut() method throws an SPException if "An error occurred when checking out the file." I would therefore assume this method executes synchronously and the file is locked after the method returns.

The CheckOut() method throws an SPException if check-out is not possible (e.g. the file is already checked out). You must handle this situation if you want to run this code in parallel.

You can either:

  • Catch the SPException and try again later.
  • Not catch (or log and re-throw) the exception and deal with it in the calling code.

Do not try to find out if the file can be checked out first. There is no guarantee that the file is checked out just before calling CheckOut().

The CheckOut() method throws an SPException if check-out is not possible (e.g. the file is already checked out). You must handle this situation if you want to run this code in parallel.

You can either:

  • Catch the SPException and try again later.
  • Not catch (or log and re-throw) the exception and deal with it in the calling code.

Do not try to find out if the file can be checked out first. There is no guarantee that the file is checked out just before calling CheckOut().

Regarding atomicity, the documentation does not explicitly say so but the CheckOut() method throws an SPException if "An error occurred when checking out the file." I would therefore assume this method executes synchronously and the file is locked after the method returns.

The CheckOut() method throws an SPException if check-out is not possible (e.g. the file is already checked out). You must handle this situation if you want to run this code in parallel.

You can either:

  • Catch the SPException and try again later.
  • Not catch (or log and re-throw) the exception and deal with it in the calling code.

Do not try to find out if the file can be checked out first. There is no guarantee that the file is checked out just before calling CheckOut().

added 39 characters in body
Source Link
helb
  • 552
  • 3
  • 14

The CheckOut() method throws an SPException if check-out ifis not possible (e.g. the file is already checked out). You must handle this situation if you want to run this code in parallel.

You can either:

  • Catch the SPException and try again later.
  • Not catch (or log and re-throw) the exception and deal with it in the calling code.

Do not try to find out if the file can be checked out first. There is no guarantee that the file is checked out just before calling CheckOut().

The CheckOut() method throws an SPException if check-out if not possible. You must handle this situation if you want to run this code in parallel.

You can either:

  • Catch the SPException and try again later.
  • Not catch (or log and re-throw) the exception and deal with it in the calling code.

Do not try to find out if the file can be checked out first. There is no guarantee that the file is checked out just before calling CheckOut().

The CheckOut() method throws an SPException if check-out is not possible (e.g. the file is already checked out). You must handle this situation if you want to run this code in parallel.

You can either:

  • Catch the SPException and try again later.
  • Not catch (or log and re-throw) the exception and deal with it in the calling code.

Do not try to find out if the file can be checked out first. There is no guarantee that the file is checked out just before calling CheckOut().

added 2 characters in body
Source Link
helb
  • 552
  • 3
  • 14

The CheckOut() method throws an SPException if check-out if not possible. You must handle this situation if you want to run this code in parallel.

You can either:

  • Catch the SPException and try again later.
  • Not catch (or log and re-throw) the exception and deal with it in the calling code.

Do not try to find out if the file can be checked out first. There is no guarantee that the file is checked out justjust before calling CheckOut().

The CheckOut() method throws an SPException if check-out if not possible. You must handle this situation if you want to run this code in parallel.

You can either:

  • Catch the SPException and try again later.
  • Not catch (or log and re-throw) the exception and deal with it in the calling code.

Do not try to find out if the file can be checked out first. There is no guarantee that the file is checked out just before calling CheckOut().

The CheckOut() method throws an SPException if check-out if not possible. You must handle this situation if you want to run this code in parallel.

You can either:

  • Catch the SPException and try again later.
  • Not catch (or log and re-throw) the exception and deal with it in the calling code.

Do not try to find out if the file can be checked out first. There is no guarantee that the file is checked out just before calling CheckOut().

Source Link
helb
  • 552
  • 3
  • 14
Loading