Clone() public method

Clones a Database Cursor
This method wraps the native ups_cursor_clone function.
Clones an existing Cursor. The new Cursor will point to exactly the same item as the old Cursor. If the old Cursor did not point to any item, so will the new Cursor. If the old Cursor is bound to a Transaction, then the new Cursor will also be bound to this Transaction.
/// /// /// if the new structure could not be allocated /// ///
public Clone ( ) : Cursor
return Cursor
Beispiel #1
0
 private void Clone()
 {
     Cursor c1 = new Cursor(db);
     Cursor c2 = c1.Clone();
 }
Beispiel #2
0
 private void AutoCleanupCursors4()
 {
     Upscaledb.Environment env = new Upscaledb.Environment();
     Database db = new Database();
     env.Create("ntest.db");
     db = env.CreateDatabase(1);
     Cursor cursor1 = new Cursor(db);
     Cursor cursor2 = cursor1.Clone();
     Cursor cursor3 = cursor1.Clone();
     Cursor cursor4 = cursor1.Clone();
     Cursor cursor5 = cursor1.Clone();
     cursor3.Close();
     cursor5.Close();
     // let gc do the cleanup
     env.Close();
 }