StrataFrame Forum

ExecuteNonQuery() and Transactions

http://forum.strataframe.net/Topic11609.aspx

By choyt - 9/19/2007

Hi Folks

Will the below ExecuteNonQuery run as part of the transaction?

TransactionBegin("", Data.IsolationLevel.RepeatableRead)

ExecuteNonQuery(c)

Something.Save(True)

TransactionCommit("")

By StrataFrame Team - 9/20/2007

Um, no, it won't, there isn't a wrapper method on the BO for that... It needs to be added.

In the meantime, you can do so through the DbDataSourceItem directly.  So, in the BO:

DbCommand c = SomeCommand
DataBasics.DataSources("key").ExecuteNonQuery(c, True, "TranKey")

By choyt - 9/21/2007

Works for me! Thanks!
By StrataFrame Team - 9/21/2007

Good to hear.  Also, if you need access to the raw SqlTransaction object, you can access it through the Transactions property on the SqlDataSourceItem.  Just give it the key, and it will return the SqlTransaction object; just in case you need to do anything with it.