Rollback fail...


Author
Message
Tiong Diu King
Tiong Diu King
StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)
Group: Forum Members
Posts: 28, Visits: 70
Hi all,



Below is my code which fail to rollback. Please advice



Public Sub thread()

Dim locblock As New BOprdyrec

Dim lnnumber As Integer



lnnumber = 1



Try

MicroFour.StrataFrame.Business.BusinessLayer.TransactionBegin("", Data.IsolationLevel.ReadCommitted)

Do While lnnumber > 0

lnnumber = lnnumber + 1

locblock.Add()

locblock.cpdrrefdoc = lnnumber.ToString

locblock.Save()

Loop

MicroFour.StrataFrame.Business.BusinessLayer.TransactionCommit("")

Catch ex As Exception

MicroFour.StrataFrame.Business.BusinessLayer.TransactionRollback("")



End Try



End Sub
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Tiong,



Look at the StrataFrame documentation under the "Using Transactional Processing" topic for more explanation.



You are missing a parameter in the Save() method to use the transaction:

locblock.Save(True)



One of the nice feature of StrataFrame is that it will allow you to save a BO with or without a transaction at any point.

Edhy Rijo

Tiong Diu King
Tiong Diu King
StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)StrataFrame Beginner (30 reputation)
Group: Forum Members
Posts: 28, Visits: 70
Thanks Edhy Rijo for ur help
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search