Hi Denis, On Feb 25, 2012, at 1:22 PM, Denis Gervalle wrote:
> On Mon, Feb 13, 2012 at 10:31, Denis Gervalle <[email protected]> wrote: > >> Hi Devs, >> >> I would like to commit the following change on the internal API of the >> hibernate store: >> >> Deprecate >> public boolean beginTransaction(boolean withTransaction, XWikiContext >> context) >> public boolean beginTransaction(SessionFactory sfactory, boolean >> withTransaction, XWikiContext context) >> in favor of >> public boolean beginTransaction(SessionFactory sfactory, XWikiContext >> context) >> >> Deprecate >> public void endTransaction(XWikiContext context, boolean commit, >> boolean withTransaction) >> public <T> T execute(XWikiContext context, boolean bTransaction, >> boolean doCommit, HibernateCallback<T> cb) >> in favor of >> public <T> T execute(XWikiContext context, boolean doCommit, >> HibernateCallback<T> cb) >> and add new method >> public <T> T failSafeExecute(XWikiContext context, boolean doCommit, >> HibernateCallback<T> cb) >> >> Deprecate >> public <T> T executeRead(XWikiContext context, boolean bTransaction, >> HibernateCallback<T> cb) throws XWikiException >> in favor of >> public <T> T executeRead(XWikiContext context, HibernateCallback<T> >> cb) throws XWikiException >> and add new method >> public <T> T executeFailSafeRead(XWikiContext context, >> HibernateCallback<T> cb) >> > > My mistake, this one should have been > > public <T> T failSafeExecuteRead(XWikiContext context, > HibernateCallback<T> cb) Reading this method name, I don't understand what it means in English. Do you mean: executeFailSafeRead() (as in: this method executes a fail safe read)? Thanks -Vincent > and I have just fixed it on master. > > >> >> Deprecate >> public <T> T executeWrite(XWikiContext context, boolean bTransaction, >> HibernateCallback<T> cb) >> in favor of >> public <T> T executeWrite(XWikiContext context, HibernateCallback<T> >> cb) throws XWikiException >> and add new method >> public <T> T failSafeExecuteWrite(XWikiContext context, >> HibernateCallback<T> cb) >> >> My motivation: >> - reduce confusion, since the current signature let you think that >> sub-transaction are possible, and these are not, since the withTransaction >> argument is unused. >> - provide an easy way to run potentially failing transaction, that will >> not do logging and neither throw. It is the responsability of the caller to >> manager the situation. >> >> The later could be use to easily check the state of the database during a >> migration for example. Is a table exists ? is column exists ? could be done >> by simple fail safe selection, if these fail, you are almost sure the table >> or column is missing. >> >> Anything against these changes ? >> >> -- >> Denis Gervalle >> SOFTEC sa - CEO >> eGuilde sarl - CTO >> >> >> > > > -- > Denis Gervalle > SOFTEC sa - CEO > eGuilde sarl - CTO > _______________________________________________ > devs mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/devs _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

