[transfer-dev] Re: Rollback 'save()' methods using Transaction advise()?

2009-01-20 Thread Mark Mandel
This is a really good question! I've done similar things in my unit tests, by cheating a little, and it worked a charm. I can't seem the find the code... but the basics went something like this (written in gmail, so errors will happen): cfcomponent extends=frameworkYouUse.TestCase cfscript

[transfer-dev] Re: Rollback 'save()' methods using Transaction advise()?

2009-01-20 Thread bimp
Mark, sweet that worked!! Now correct me if I'm wrong. With this type of implementation of rolling back, this assumes that in addition to the test functions being advised by the Transaction class, that all the functions being tested in the service, gateway, and business objects need to also be

[transfer-dev] Re: Rollback 'save()' methods using Transaction advise()?

2009-01-20 Thread bimp
Mark, Thanks again but one thing I noticed. The cftransaction action=rollback works in that the newly inserted test record doesn't appear post-test in my table. However the autoincrement ID field of that same table does actually increase in my SQL Server table. I confirmed this by first

[transfer-dev] Re: Rollback 'save()' methods using Transaction advise()?

2009-01-20 Thread Bob Silverberg
That is the nature of identity fields in SQL Server. There's nothing you can do about it (short of running a DBCC CHECKIDENT command, which you don't want to do), but it really should have no bearing on your application. You should not be counting on the value of your identity fields being in