RE: Instantiate more than one session bean

2000-11-22 Thread Russ White

AFAIK there should be no problem when multiple threads are sharing a single home
interface. But I not ever have threads sharing a single remote reference no
matter what. That is asking for trouble.

It is actually safest to have the threads just share a context and have the
thread lookup the home interface and grab an instance of the ejb. This may be
somewhat slower and more memory intensive.

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Storm Linux
> User
> Sent: Wednesday, November 22, 2000 1:07 PM
> To: Orion-Interest
> Subject: Re: Instantiate more than one session bean
>
>
> On Wednesday 22 November 2000 11:34, you wrote:
> > At 09:50 22.11.00 , you wrote:
> > >On Tuesday 21 November 2000 12:47, you wrote:
> > > > >Is it possible to instatiate more than one session bean from the same
> > > > > class,
> > > > >
> > > > >for the same session? I'm planning to make a mullti-threaded servlet
> > > > > that
> > > >
> > > > you mean the same httpsession, don't you?
> > >
> > >Yes, the same HttpSession ...
> > >
> > > > >each thread instantiate one session bean object and works with it.
> > > >
> > > > could you describe a little more what you're trying to achieve?
> > >
> > >I need to execute something concurrently. For this, I need many session
> > > beans for the same class and then excute these session beans from a
> > > multi-threaded servlet.
> >
> > I was asking about the use case you're modelling, not the particular
> > implementation problem. so I still didn't get how the relationship between
> > session beans and http-sessions is in your case. what do you mean by
> > multi-threaded? multiple http requests executed on the servlet concurrently
> > or multiple threads that are started by one http request that invoke
> > session bean methods?
>
> Yeees, you got it! The second case you describe: Multiple threads that are
> started by one http request that invoke session bean methods What do you
> suggest me to do ?
>
> Thanks very much!!!
>
> []s
> Guilherme Ceschiatti
> [EMAIL PROTECTED]
>
>





Re: Instantiate more than one session bean

2000-11-22 Thread Storm Linux User

On Wednesday 22 November 2000 11:34, you wrote:
> At 09:50 22.11.00 , you wrote:
> >On Tuesday 21 November 2000 12:47, you wrote:
> > > >Is it possible to instatiate more than one session bean from the same
> > > > class,
> > > >
> > > >for the same session? I'm planning to make a mullti-threaded servlet
> > > > that
> > >
> > > you mean the same httpsession, don't you?
> >
> >Yes, the same HttpSession ...
> >
> > > >each thread instantiate one session bean object and works with it.
> > >
> > > could you describe a little more what you're trying to achieve?
> >
> >I need to execute something concurrently. For this, I need many session
> > beans for the same class and then excute these session beans from a
> > multi-threaded servlet.
>
> I was asking about the use case you're modelling, not the particular
> implementation problem. so I still didn't get how the relationship between
> session beans and http-sessions is in your case. what do you mean by
> multi-threaded? multiple http requests executed on the servlet concurrently
> or multiple threads that are started by one http request that invoke
> session bean methods?

Yeees, you got it! The second case you describe: Multiple threads that are 
started by one http request that invoke session bean methods What do you 
suggest me to do ?

Thanks very much!!!

[]s
Guilherme Ceschiatti
[EMAIL PROTECTED]




Re: Instantiate more than one session bean

2000-11-22 Thread Robert Krueger

At 09:50 22.11.00 , you wrote:
>On Tuesday 21 November 2000 12:47, you wrote:
>
> > >Is it possible to instatiate more than one session bean from the same
> > > class,
> > >
> > >for the same session? I'm planning to make a mullti-threaded servlet that
> >
> > you mean the same httpsession, don't you?
>
>Yes, the same HttpSession ...
>
> > >each thread instantiate one session bean object and works with it.
> >
> > could you describe a little more what you're trying to achieve?
>
>I need to execute something concurrently. For this, I need many session beans
>for the same class and then excute these session beans from a multi-threaded
>servlet.

I was asking about the use case you're modelling, not the particular 
implementation problem. so I still didn't get how the relationship between 
session beans and http-sessions is in your case. what do you mean by 
multi-threaded? multiple http requests executed on the servlet concurrently 
or multiple threads that are started by one http request that invoke 
session bean methods?

robert

>[]s
>Guilherme Ceschiatti
>

(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de





Re: Instantiate more than one session bean

2000-11-22 Thread Storm Linux User

On Tuesday 21 November 2000 12:47, you wrote:

> >Is it possible to instatiate more than one session bean from the same
> > class,
> >
> >for the same session? I'm planning to make a mullti-threaded servlet that
>
> you mean the same httpsession, don't you?

Yes, the same HttpSession ...

> >each thread instantiate one session bean object and works with it.
>
> could you describe a little more what you're trying to achieve?

I need to execute something concurrently. For this, I need many session beans 
for the same class and then excute these session beans from a multi-threaded 
servlet.

[]s
Guilherme Ceschiatti





RE: Instantiate more than one session bean

2000-11-21 Thread Juan Lorandi (Chile)

perhaps you would be straining both the apps servers & the island LAN if you
should use the httpsession object...

for small apps, he shouldn't have any problems with httpsession, and it's
what I would use.

But many times I've seen programmers thinking servlet containers behave
one-way, when they actuallly behave a different way

If the idea is to have a servlet REPLACING th Web server functionality, then
it's ok(say, listening to port 6667 to implement an IRC server, then having
for each room for each client a session bean... it should be ok)

If the idea is to have the servlet WITHIN the Web server (HTTPServlet),
mayhem starts, specially if you want thing to run in different web
servers...

Some web containers use the same instance of a servlet for *EVERY* request
(JRun)
Some use the same instance up to N concurrent users...

So, I wouldn't want to use threads in any HTTPServlet, because it could mean
more trouble than it's worth.

Sometimes, tough, it may become necesary, and when those times come, be
extremely careful designing both the Session Beans and the servlet...

That's all folks

Rifle



-Original Message-
From: Robert Krueger [mailto:[EMAIL PROTECTED]]
Sent: Martes, 21 de Noviembre de 2000 11:47
To: Orion-Interest
Subject: RE: Instantiate more than one session bean


At 10:57 21.11.00 , you wrote:
>that's valid... but be careful... some servlet engines are known to 'reuse'
>the same instance of a servlet many times

why would that matter? if he associates the session beans with the 
httpsession there is no problem, no matter what type of reuse policy the 
servlet container uses or am I missing something? are you implying he's 
using instance variables for storing the sb references? that wouldn't be 
thread safe. either he uses ThreadLocals or session variables. anything 
else would not be correct IMO.

regards,

robert


>-Original Message-
>From: Storm Linux User [mailto:[EMAIL PROTECTED]]
>Sent: Lunes, 20 de Noviembre de 2000 17:54
>To: Orion-Interest
>Subject: Instantiate more than one session bean
>
>
>Hi..
>
>Is it possible to instatiate more than one session bean from the same
class,
>
>for the same session? I'm planning to make a mullti-threaded servlet that

you mean the same httpsession, don't you?

>each thread instantiate one session bean object and works with it.

could you describe a little more what you're trying to achieve?

robert

>Thanks!
>
>[]s
>Guilherme Ceschiatti
>[EMAIL PROTECTED]

(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de





RE: Instantiate more than one session bean

2000-11-21 Thread Gerald Gutierrez


Would implementing SingleThreadModel "fix" this?

At 10:57 AM 11/21/2000 -0300, you wrote:
>that's valid... but be careful... some servlet engines are known to 'reuse'
>the same instance of a servlet many times
>
>-Original Message-
>From: Storm Linux User [mailto:[EMAIL PROTECTED]]
>Sent: Lunes, 20 de Noviembre de 2000 17:54
>To: Orion-Interest
>Subject: Instantiate more than one session bean
>
>
>Hi..
>
>Is it possible to instatiate more than one session bean from the same class,
>
>for the same session? I'm planning to make a mullti-threaded servlet that
>each thread instantiate one session bean object and works with it.
>
>Thanks!
>
>[]s
>Guilherme Ceschiatti
>[EMAIL PROTECTED]






RE: Instantiate more than one session bean

2000-11-21 Thread Robert Krueger

At 10:57 21.11.00 , you wrote:
>that's valid... but be careful... some servlet engines are known to 'reuse'
>the same instance of a servlet many times

why would that matter? if he associates the session beans with the 
httpsession there is no problem, no matter what type of reuse policy the 
servlet container uses or am I missing something? are you implying he's 
using instance variables for storing the sb references? that wouldn't be 
thread safe. either he uses ThreadLocals or session variables. anything 
else would not be correct IMO.

regards,

robert


>-Original Message-
>From: Storm Linux User [mailto:[EMAIL PROTECTED]]
>Sent: Lunes, 20 de Noviembre de 2000 17:54
>To: Orion-Interest
>Subject: Instantiate more than one session bean
>
>
>Hi..
>
>Is it possible to instatiate more than one session bean from the same class,
>
>for the same session? I'm planning to make a mullti-threaded servlet that

you mean the same httpsession, don't you?

>each thread instantiate one session bean object and works with it.

could you describe a little more what you're trying to achieve?

robert

>Thanks!
>
>[]s
>Guilherme Ceschiatti
>[EMAIL PROTECTED]

(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de





RE: Instantiate more than one session bean

2000-11-21 Thread Juan Lorandi (Chile)

that's valid... but be careful... some servlet engines are known to 'reuse'
the same instance of a servlet many times

-Original Message-
From: Storm Linux User [mailto:[EMAIL PROTECTED]]
Sent: Lunes, 20 de Noviembre de 2000 17:54
To: Orion-Interest
Subject: Instantiate more than one session bean


Hi..

Is it possible to instatiate more than one session bean from the same class,

for the same session? I'm planning to make a mullti-threaded servlet that 
each thread instantiate one session bean object and works with it.

Thanks!

[]s
Guilherme Ceschiatti
[EMAIL PROTECTED]