Subj : Re: Adding operator to javascript To : netscape.public.mozilla.jseng From : Ruslan Cheremin Date : Thu Sep 01 2005 12:30 pm > This statement can be supported by creating some public interface, > which includes methods like: > onStartTransaction() > onCommit() > onRollback() > Implementing this interface in custom transaction manager will give us > possibility to create some instance of it for each transaction. So we > will get a possibility to use any specific transaction manager we need > without hacking Rhino in some non-transparent way. > > The way I can work with transactions now is following > > myTransactionManager.beginTransaction() > try > { > ...some code goes here... > myTransactionManager.commitTransaction() > } > catch(ex) > { > myTransactionManager.rollbackTransaction(); > } > > Disadvantage of this structure is that user should explicitly specify > instance of transaction manager and call its methods. If we replace it > with some statement like the one I've proposed, we can hide our > internal implementation. Why you can't use construction like this txManager.execute( function(){ //statements under tx control going here } ); where txManager is host object like document or window in browser's DHTML? Sincerely, Cheremin Ruslan .