09-10-2023 04:06 PM
In the application I'm building, I have a need to make several insert/update/deletes for different custom tables, but the database call for those changes should happen within a transaction. Are there any OneStream API functions that will include the ability to run the database call as a transaction? I could just use the .NET Framework approach (SqlCommand), but then I'm a bit off the track.
Cheers, Frank
Solved! Go to Solution.
09-11-2023 02:37 AM
Answer to my own question is, that a Begin and Commit Transaction exists in the OneStream API, through the DbConnInfo class
'' The Brapi.Database.DbConnInfo have methods for begin, commit and rollback
Using dbCon as DbConnInfo = Brapi.Database.CreateDatabaseConnectionInfo(si)
dbCon.BeginTrans()
'' Do calls to db
dbCon.CommitTrans()
End Using
09-11-2023 02:37 AM
Answer to my own question is, that a Begin and Commit Transaction exists in the OneStream API, through the DbConnInfo class
'' The Brapi.Database.DbConnInfo have methods for begin, commit and rollback
Using dbCon as DbConnInfo = Brapi.Database.CreateDatabaseConnectionInfo(si)
dbCon.BeginTrans()
'' Do calls to db
dbCon.CommitTrans()
End Using