Sweat the onions and garlic in the olive oil, not allowing them to brown. Add the tomatoes, stirring occasionally, allowing the mixture to reduce by about half. Add the sugar, salt, pepper and wine. Continue to cook over low heat until this mixture reduces by another half or to a thick consistency. Stir in the herbs, and then turn off heat. Transfer to a glass bowl and cool to room temperature. Store in jars with tight fitting lids and refrigerate. Jam will store for up to 7 days. Use as a condiment instead of ketchup or as a bruschetta topping.