Re: [Patch] Update view-database only if the transaction succeeded

Kevin Rosenberg <kevin-HJRc7zDS/[email protected]> Thu, 13 Sep 2007 15:21:24 -0600
Newsgroups gmane.lisp.clsql.devel
Message-ID <[email protected]>
Saurabh Nanda wrote:
> No. I thought of that. *transaction-insert-list* is bound only when
> you're using the with-transaction macro. However, someone may use
> start-transaction/commit/rollback separately which is going to break
> everything. If and only if the dynamic context for
> *transaction-insert-list* is set, should we push objects into it.

I had only looked at your patch in isolation. I briefly reviewed
transactions.lisp and had a few ideas. 

Rather than a special variable, what about putting the view-object
rollback information in the transaction object as an additional slot?

Is the a great reason not to put the view-object rollback code in
database--start-transaction and database-rollback, rather than in
with-transaction?  With-transaction is of course nice because you get
rollback when if you abort out of the unwind-protect. But, given that
CLSQL works to provide full transaction support with start-transaction
and rollback, moving these the view-object code so that it is also
supported by those functions seems like a win.
 
-- 
Kevin Rosenberg
[email protected]