The purpose of this topic is to illustrate you the most important API differences between Telerik Data Access and NHibernate regarding the CRUD operations. After converting your project from NHibernate to Telerik Data Access, it may be no longer buildable. In most of the cases the reason for this will be the various API differences.

The OpenAccessContext is the main runtime class you will use when working with Telerik Data Access. This is the central API class providing methods for CRUD operations. It can either be generated by the Add New Domain Model Wizard, or defined by you if you are using the code-only approach. Basically, the OpenAccessContext is equivalent to the ISession object in NHibernate.

A transaction is an indivisible unit of work and it is used to ensure data integrity. Transactions control the concurrent access of data by multiple programs. In the event of a system failure, transactions ensure that after recovery the data is in a consistent state. All operations on a persistent class need to be carried out within a transaction. Transactions are started automatically and all changes are persisted in-memory. A transaction can end in two ways: with a commit or a rollback. OpenAccessContext.SaveChanges() attempts to save all the changes to the database, however, if any statement within the transaction fails, the transaction is rolled back, undoing all the effects of the statements in the transaction.

All the changes you make using a single context are considered a transaction, which can be committed through the SaveChanges method. You can also perform a rollback through the ClearChanges method. A new transaction is started automatically afterwards.