Why does rollback leave a row with all nulls in the database when the table has an id with autoincrement?
public class TestRollback
{
[ServiceStack.DataAnnotations.AutoIncrement]
public int Id { get; set; }
[Required]
public string Data { get; set; }
}
public void TestRollback()
{
using (IDbTransaction transaction = Db.OpenTransaction(IsolationLevel.Serializable))
{
try
{
TestRollback test = new TestRollback();
//test.Data = "This is test1";
var saved = Db.Save(test); //This will fail because test.Data is required
transaction.Commit();
}
catch (Exception e)
{
transaction.Rollback();
}
}
}