Re: Multi-threaded servlet environment - Mailing list pgsql-jdbc

From Jan de Visser
Subject Re: Multi-threaded servlet environment
Date
Msg-id 200312301310.40530.jdevisser@digitalfairway.com
Whole thread Raw
In response to Re: Multi-threaded servlet environment  (Dave Cramer <pg@fastcrypt.com>)
List pgsql-jdbc
On Tuesday 30 December 2003 09:42, Dave Cramer wrote:
> Marcus,
>
> That's simply amazing, that anyone would prohibit you from writing legal
> java inside a container.
>
Well, the point is that you usually can create your own threads. However, as
someone else mentioned before, creating threads in the EJB tier of a J2EE
container is discouraged according to the spec. Reasons are many, but mainly
boil down to issues of resource management, where resources are things like
database- or JMS connections, and EJB instances. Another fairly important
aspect is security; the container has no way of knowing what the principal
associated with the thread is, so it cannot determine if it actually is
allowed to access said resources.

That said, threads not accessing any container resources (database/JMS
connections, EJBs, etc) are usually not a problem.

> Have a look at jboss, and see if it can solve your problems.

JBoss needs an ugly hack (a static method needs to be called) to set the
proper security context on a thread.

>
> Dave

JdV!!

>
> On Tue, 2003-12-30 at 01:59, Marcus Andree S. Magalhaes wrote:
> > We were about to lose a support agreement with BAE/Weblogic people
> > simply because we were creating threads on our own.  No reasons
> > were given to us, but they (BES) simply don't *recommend* the
> > arbitrary creation of threads.
> >
> > I suspect it's this way because people can easily create lots of
> > leaks, excessive CPU usage or something like that and then blame
> > the application server for its ridiculous performance.
> >
> > > David,
> > >
> > > There's no problem creating threads inside a servlet container.
> > >
> > > Dave

--
==============================================================
Jan de Visser                     Digital Fairway Corp.
tel. (416) 628 7525               jdevisser@digitalfairway.com

          <Enter any 12 digit prime to continue>
==============================================================

pgsql-jdbc by date:

Previous
From: "David Wall"
Date:
Subject: Re: Multi-threaded servlet environment
Next
From: Henrik Andersson
Date:
Subject: getGeneratedKeys()