StrataFrame Forum

Transaction Support For DeleteByPrimaryKey

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

By Ertan Deniz - 4/10/2008

I need to execute DeleteByPrimaryKey as part of a transaction.

I've seen that Overload method does not exist.

What should I do ? If I use QueryInformation class for delete ,How can I execute this instance of QueryInformation. ?

We know that FillDataTable gets QueryInformation as parameter for fill queries. But What about Delete,update,Insert Queries ?

By Trent L. Taylor - 4/11/2008

You will not want to use the DeleteByPrimaryKey command but rather the DeleteCurrentRow command.  Then when you save on the transaction this record will be deleted on the transaction.  The transaction is started at the point of the Save(), so if you call the DeleteByPrimaryKey it will just delete the record from the server outside of the transaction.
By Ertan Deniz - 4/11/2008

I want to use DeleteByPrimaryKey method. But I need to run that method as part of a transaction.

As I understand, It is not used this way. If I call this method between TransactionBegin and TransactionCommit statements, It is executed outside the transaction.

By Ertan Deniz - 4/15/2008

DeleteCurrentRow() is executed by internally with two parameters having true values. (CheckSecurity,OnlyMarkAsDeleted)

In this case, there is a conflict with documentation. DeleteCurrentRow(true,true) will mark the current record as deleted.

From StrataFrame Documentation

"DeleteCurrentRow()
When this overload is called, the record being deleted is immediately removed from the server and the internal data table is updated."

By Trent L. Taylor - 4/15/2008

There is no conflict with the documentation.  If you call the DeleteCurrentRow with a False, then it is immediately removed from the server.