0

open session in view commit send message to client

asked 2013-08-01 13:38:05 +0800

javiut gravatar image javiut flag of Venezuela, Bolivarian Republic of
90 1 5

updated 2013-08-01 13:39:01 +0800

hello folks we have implemented in our APP the Open Session in view pattern everything works like expected but our APP sometimes throws some errors on commit my question is how i publish those error to the client.. take a look what i have try so far.

1). throw a Business Exception but is not throw to the client.

2). show a messageBox throws java.lang.IllegalStateException: UI can't be modified in the rendering phase

3). open a modal window with the message throws java.lang.IllegalStateException: UI can't be modified in the rendering phase

the exception is being logged to the server log but the client is unaware that the exception ever exist and is causing some headaches to us.

here is some code.

 public void cleanup(Execution exec,Execution parent,List<Throwable>errs)
{
    HibernateSessionsUtil sessionsUtils = (HibernateSessionsUtil)SpringUtil.getBean("sessionsUtils");
    if (parent == null)
        if (errs == null || errs.isEmpty())
        {
            try{sessionsUtils.currentSession().getTransaction().commit();}catch(Exception e)
            {log.error(e.getMessage());final Throwable ex=(Throwable)e;rollback(exec,ex);showErrorMessage(e);}

        } else
        {               
            final Throwable ex = errs.get(0);           
            rollback(exec,ex);
            showErrorMessage(ex);
        }
    }
}

here is the method which shows the error to client [pretend to show it]

 private void showErrorMessage(Throwable error)
{
    StringBuilder message = ...............................................................
    windowHelper.openModalWindow("........commiterror.zul",message);
    return;
}

please help me thanks a lot.

delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-08-01 13:38:05 +0800

Seen: 7 times

Last updated: Aug 01 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More