P
pljosh.mail
Hello there,
I am beginning with EJB and I have question about implementing simple
progress indicator in client that is calling time consuming session
bean.
I have one stateful session bean that imports data from one database
into another. It takes very long time to copy everything and that is
happening in one transaction.
My client is a Swing application launched inside Application Client
Container (ACC).
When I press a button, it calls session bean's method and starts
importing data. The problem is that it can take long time and I would
like to show some progress, like number of imported entities or
something like this.
I tried implementing it in such a (wrong as I know now) way:
I added a field in that session bean called rowNo and getRowNo() method
and I was trying to call that method during importing data in another
thread to read progress. As you know, it is not working, because when I
call migrate() method and then getRowNo() from another thread - I get
javax.ejb.ConcurrentAccessException - one cannot execute multiple
methods of the same session bean (stateful in my case).
My question is how this can be done?
Thanks,
Witek
I am beginning with EJB and I have question about implementing simple
progress indicator in client that is calling time consuming session
bean.
I have one stateful session bean that imports data from one database
into another. It takes very long time to copy everything and that is
happening in one transaction.
My client is a Swing application launched inside Application Client
Container (ACC).
When I press a button, it calls session bean's method and starts
importing data. The problem is that it can take long time and I would
like to show some progress, like number of imported entities or
something like this.
I tried implementing it in such a (wrong as I know now) way:
I added a field in that session bean called rowNo and getRowNo() method
and I was trying to call that method during importing data in another
thread to read progress. As you know, it is not working, because when I
call migrate() method and then getRowNo() from another thread - I get
javax.ejb.ConcurrentAccessException - one cannot execute multiple
methods of the same session bean (stateful in my case).
My question is how this can be done?
Thanks,
Witek