Dice the pancetta and sweat it with half the chopped onion in the oil over a medium heat; when the onion starts to caramelize, add the tomatoes and basil, and season with salt and pepper. Simmer for 30 minutes. This sauce will be used to dress the rice. In the meantime, warm the stock in a saucepan for the rice. Put the butter and the other half chopped onion in a saucepan and sweat the onion until it is very soft; pour in a little stock while cooking and let the onions reduce, then add the rice, stir for a few minutes to coat the rice completely and then pour in half the warm stock. Keep mixing and slowly add the rest of the stock a little at a time, stirring continuously with a wooden spoon. Cook for about 20 minutes, stirring, until the rice is cooked but still has a slight bite, and nearly all the stock has been absorbed. Then add the tomato sauce and the grated parmesan. Stir through to mix thoroughly, and leave to stand for a few minutes before serving.