your inserting 200,000 records and then deleting 200,000 records one by one. no matter what that will take some time. the sql looks like this
delete from [table] where [pk] = 1
delete from [table] where [pk] = 2
delete from [table] where [pk] = 3
delete from [table] where [pk] = 200,000
if possible use the adapter.DeleteEntitiesDirectly(); function. that will generate
delete from [table] where [pk] in (1, 2, 3, ... 200,000)
if you still have issues, break the collection up into smaller chunks and commit each chunk
if (collection.count > 100000)
{
int max = 50000;
while (collection.count > 0)
{
if (collection.count < 50000) max = collection.count;
subset = collection.getrange(0, max);
adapter.starttransaction();
adapter.deletecollection(subset);
adapter.commit();
collection.remorerange(0, max);
}
}
else
{
adapter.starttransaction();
adapter.deletecollection(collection);
adapter.commit();
}