You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Tokalak Ahmet <to...@yahoo.de> on 2009/07/17 11:24:10 UTC

Background-Thread blocking Wicket-App

Hi All,

we've got a page which does time consuming tasks. 
Because of that, every time a user calls the page a new background-thread is started (only if not running already) and 
the user is informed that the task is running and the page will be updated with fresh data as quickly as the thread has finished.

We've realized that the WHOLE application is blocked until the background-thread finishes. That is no other page can be called
by the user who has started the thraed. The app is also not responding to other users as long as the thread is running.

The background thread class i'm using is a simple thread extending the thread class and retrieving data from a very very big database in its run method.

I'm using Wicket 1.3.5 on Tomcat6.0.18

Any ideas?


      

AW: Background-Thread blocking Wicket-App

Posted by Tokalak Ahmet <to...@yahoo.de>.
Thanks you and Jonas for the feedbacks.

You reminded me of the kind of usage of the Connection object. On first request after the application has started, a permanent connection is established and used by all following requests.
I've forgotten to change this after the first development steps :-(  
Thank you for reminding me of this.
The code looks like:

public class ConnectionFactory {
    private static Connection conn = null;
   
    private ConnectionFactory() {
    }

    public static Connection getConnection() throws Exception {
        if (conn == null) {
            ...
            conn = DriverManager.getConnection(url, user, password);
        }

        return conn;
    }
}








________________________________
Von: Russell Simpkins <ru...@hotmail.com>
An: users@wicket.apache.org
Gesendet: Freitag, den 17. Juli 2009, 12:15:06 Uhr
Betreff: RE: Background-Thread blocking Wicket-App


Running a thread should not block the entire application - are you using connection pooling with more than one max active connection? Maybe you should send the code you use to kick off the thread. If you have any code that is synchronized on a shared resource, that might block others.
Russ


> Date: Fri, 17 Jul 2009 09:24:10 +0000
> From: tokalak@yahoo.de
> Subject: Background-Thread blocking Wicket-App
> To: users@wicket.apache.org
> 
> Hi All,
> 
> we've got a page which does time consuming tasks. 
> Because of that, every time a user calls the page a new background-thread is started (only if not running already) and 
> the user is informed that the task is running and the page will be updated with fresh data as quickly as the thread has finished.
> 
> We've realized that the WHOLE application is blocked until the background-thread finishes. That is no other page can be called
> by the user who has started the thraed. The app is also not responding to other users as long as the thread is running.
> 
> The background thread class i'm using is a simple thread extending the thread class and retrieving data from a very very big database in its run method.
> 
> I'm using Wicket 1.3.5 on Tomcat6.0.18
> 
> Any ideas?
> 
> 
>      

_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits. 
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009


      

RE: Background-Thread blocking Wicket-App

Posted by Russell Simpkins <ru...@hotmail.com>.
Running a thread should not block the entire application - are you using connection pooling with more than one max active connection? Maybe you should send the code you use to kick off the thread. If you have any code that is synchronized on a shared resource, that might block others.
Russ


> Date: Fri, 17 Jul 2009 09:24:10 +0000
> From: tokalak@yahoo.de
> Subject: Background-Thread blocking Wicket-App
> To: users@wicket.apache.org
> 
> Hi All,
> 
> we've got a page which does time consuming tasks. 
> Because of that, every time a user calls the page a new background-thread is started (only if not running already) and 
> the user is informed that the task is running and the page will be updated with fresh data as quickly as the thread has finished.
> 
> We've realized that the WHOLE application is blocked until the background-thread finishes. That is no other page can be called
> by the user who has started the thraed. The app is also not responding to other users as long as the thread is running.
> 
> The background thread class i'm using is a simple thread extending the thread class and retrieving data from a very very big database in its run method.
> 
> I'm using Wicket 1.3.5 on Tomcat6.0.18
> 
> Any ideas?
> 
> 
>       

_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits. 
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009

Re: Background-Thread blocking Wicket-App

Posted by Jonas <ba...@gmail.com>.
Sounds like your background thread is holding a lock that is also
acquired during page rendering. Maybe you can find
out which lock is contended by creating a thread dump using visualvm
or jstack from jdk 1.6


On Fri, Jul 17, 2009 at 11:24 AM, Tokalak Ahmet<to...@yahoo.de> wrote:
> Hi All,
>
> we've got a page which does time consuming tasks.
> Because of that, every time a user calls the page a new background-thread is started (only if not running already) and
> the user is informed that the task is running and the page will be updated with fresh data as quickly as the thread has finished.
>
> We've realized that the WHOLE application is blocked until the background-thread finishes. That is no other page can be called
> by the user who has started the thraed. The app is also not responding to other users as long as the thread is running.
>
> The background thread class i'm using is a simple thread extending the thread class and retrieving data from a very very big database in its run method.
>
> I'm using Wicket 1.3.5 on Tomcat6.0.18
>
> Any ideas?
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org