Topics: Writing modules
Aug 24, 2011 at 4:37 PM
Edited Aug 24, 2011 at 4:38 PM

I need write large quantities data to database,it takes long time, the error is :transaction time out

How to commit transaction by code?


for (int i = 0; i < 1000000; i++) 
	var product = _contentManager.Create("product");                 

	product.As<productPart>().Name = "something";   

        //here I want to commit transaction 


Aug 24, 2011 at 7:26 PM

I don't think you can at the moment but you should be able to split them in smaller, scheduled batches. See the BlogML import/export module for an example of something very similar.