Hey Matthew, 2012/1/4 Matthew Sherborne <msherbo...@gmail.com>: > That was a super interesting discussion :) > > My 2c is .. I can see both points of view. It is one more thing to add to > the learning curve of Wt.
True, although it is not something that a user will hit soon ? > It may break some existing code that relies on the default rollback > behaviour. Yes. This will be documented in the release notes. I believe the code will be more clear however, since a rollback() will stand out much better than a missing commit(). > void save() { > dbo::Session&s = getSession(); > dbo::Transaction t(s); > > dbo::ptr<BlogPost> post = getPost(); > post->setTitle(_title->textValue()); > > if (user->hasWriteToUpdate(post)) { > t.commit(); > } > } > > I'm thinking there may be some checks you'd want to do during a transaction, > that may inolve more DB queries. Of course this could be written instead: > > ... > if (!user->hasWriteToUpdate(post)) { > t.rollback(); > } > ... > > So in summary, I guess its up to the dev team to weight up the pros and > cons: I believe it's helped me already, so I would be curious how it evaluates in real projects. So we're going to leave this in and take it out if we get complaints later. Regards, koen ------------------------------------------------------------------------------ Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox _______________________________________________ witty-interest mailing list witty-interest@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/witty-interest