Database Transaction

FrankDK
Contributor

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

1 ACCEPTED SOLUTION

FrankDK
Contributor

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

 

 

 

View solution in original post

1 REPLY 1

FrankDK
Contributor

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