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)