I did. The problem is that I need to control from my application when to
commit. So I guess I would need to work with the object in memory, push
all the CRUD operations into an array, and execute them all within one
transaction block. That means all operations are rolled back if one of
them fails. Or am I wrong?
Basically my users want to have all the INSERT, UPDATE, DELETE
statements executed by the database, so they immediately know when one
operation failed,eg due to constraints violations, and to control when
to issue a COMMIT.
Is there a way or workaround to do this in rails ? So far the only
statement I found that does an UPDATE without issuing a COMMIT when I
set
it is because that doc did not help that I posted in this forum.
AR::transaction examples will issue all SQL commands within the
transaction block in one go.
How do I create rails actions (insert, delete, update) with a separate
‘commit’ action? I mean I cannot have an open ‘transaction do’ line, or
am I wrong? Can I use some sort of ‘yield’ command to wrap my rails
actions in a transaction block?