How to Use transactions in xcode

Source: Internet
Author: User

Not to mention nonsense.Code:

// Start the transaction before try

Meta. begintrans ();

Try {

// Do something

// We strongly recommend that you only commit the transaction once as much as possible to avoid confusion.

Meta. Commit ();

}

Catch {

// If an error occurs, you need to roll back the transaction.

Meta. rollback ();

// Continue to throw an exception

Throw;

}

Xcode also supports multi-level transactions. In fact, except that the first-level transaction is a real transaction, all the transactions above the first-level transaction are transaction counters plus one minus one, begintrans plus one, when the commit and rollback values are reduced to 0, the actual commit or rollback is performed.

The implementation of this multi-level transaction is relatively simple and only common cases are taken into account.

Xcode address: http://xcode.codeplex.com

BTW, show it in advanceNewlife. xcode v8.0

1. Extended Data Model

2. added the index and table relationship features to automatically generate extended attributes.

3. The other side also has extended attributes.

4. You can generate an extended query based on the index (the entity cache is automatically used for optimization)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.