Commit after Truncate ?

Dec 30, 2010 at 5:43 PM

Hello,

I tried to truncate a table but if I query the table just after I still got records in it. If I delete, it's working.

DatabaseService.Current.Database.Truncate(typeof(UserInfos));
//not null
var userDb = DatabaseService.Current.Database.Query<UserInfos, string>().FirstOrDefault();

DatabaseService.Current.Database.Delete(userInfos);
//null
var userDb = DatabaseService.Current.Database.Query<UserInfos, string>().FirstOrDefault();

Should I call something after the truncate ? I try Flush() but it's not working.

Matthieu 

Coordinator
Dec 30, 2010 at 6:14 PM

I just checked in a fix for that, and added a new test.

Dec 30, 2010 at 6:21 PM

wow, fast fix. The delete was ok for me, but I will certainly need the Truncate feature soon enough.

Thanks Jeremy !

Matthieu

Jan 1, 2011 at 9:04 PM

Just to let you known that I was able to use the truncate feature with the latest source code version. Thanks again.

Matthieu