Transaction for database query

92 Views Asked by At

I have been using Rhom to store data of the users, but while inserting the data, if you some parsing reasons the app gets some error, the the partial data get inserted into the db.

Do we have any database transaction concept fro Rhom database query ?

1

There are 1 best solutions below

0
Ashis Kumar On

Fortunately, yes rhodes do have as below,

db = ::Rho::RHO.get_src_db("Model")
db.start_transaction

begin            
    # your logic
    db.commit
rescue
    db.rollback
end