Problems with push to display notification from background thread


here is the sample code:

My UI subclass has an @Push annotation:

@Push(transport = Transport.STREAMING)
public class CasePortalApplication extends UI {

I have a worker thread that calls executeDeletion():

                    logger.debug("Execute deletion");
                    new Thread(){
                        public void run() {
                    logger.debug("Deletion executed");

and executeDeletion does a long running job and then displays a notification box:

private void executeDeletion()
   // do long-running operation here!
    casePortalApplication.access(new Runnable() {
        public void run()

But the notification is not displayed (without the background thread and UI.access this did work fine).
There is no exception in the log.

Any ideas? (Tomorrow I will try to call UI.push() explicitly)

Thanks and Best Regards,

I tried a bit more:

  • casePortalApplication.push() does not help
  • calling notifier.showNotification(message); directly (i.e. not from access() Runnable) works

Does anybody have an idea? Many Thanks in advance!!

Can you post more code? What you have posted works for me.

By the way Transport.STREAMING is deprecated in favor of Transport.LONG_POLLING

hello Marco,

What works for you? The direct call to notifier.showNotification() or the
ui.access() solution? I am not sure the direct call works in all cases :-/

I will try LONG_POLLING for the next stable release.

Thanks and Best Regards,

The ui.access() solution works for me