added test for checking delete-order (record -> restricted by record, restricted by record -> record). Got error for the second case! Fixed the delete-order within sql-transaction.