Re: servlet+thread+jni




"stef" <spe@xxxxxxxxxx> wrote in message
news:425afe99$0$28600$636a15ce@xxxxxxxxxxxxxxx
> Hi again :)
>
> Thx for the anwser
>
>>
>> A) Make your servlets single threaded by default (using the config of
>> your
>> web app), but his could cause you some
>
> SPG, what you say, is very interesting...
>
> What kind of action/consequence have the fact to switch servlet to single
> thread ?
> Does it mean java will use fork() instead (I go crazy :))
>
> Seriously. How java does to manager multi-connexion in this case ?
> May be playing with synchronize() palette functions
>
> Could U tell me more please ?
>
>
> thanx :)
>
>
>
>
>
>
Stef,

If you make your servlets signle threaded, then you will (and I think I need
to consult docs to be 100% on this) create a new instance of your servlet on
each connection, hence put some extra load on the servers and could cause
you some performance. This also means one connection at a time hence all
other connections are queued... Again, causing some unwanted delays to your
users..

Another problem with making your servlet single threaded is that it only
makes the specific servlet single threaded. Shared resources will still be
vulnerable.

My suggestion is that you identify your potential critical sections of code
(IE: Where you need to make calls out via JNI ) and synchronize specifically
around these. Be careful not to over synchronize else you will hit more
performance issues.

Have a look through the java.sun.com forums and see examples there..

Steve


.



Relevant Pages

  • Re: [VulnWatch] The Java applet sandbox and stateful firewalls
    ... Is the Java Sandbox able to create outgoing connections on ports like 445? ... >This is a passive attack. ... The applet initiates a TCP connection back to the originating ... > A FTP server on the same machine that hosts the originating web ...
    (Bugtraq)
  • [Full-disclosure] Re: [VulnWatch] The Java applet sandbox and stateful firewalls
    ... Is the Java Sandbox able to create outgoing connections on ports like 445? ... >This is a passive attack. ... The applet initiates a TCP connection back to the originating ... > A FTP server on the same machine that hosts the originating web ...
    (Full-Disclosure)
  • Re: Accessing DB2 with Java?
    ... Seems to me that you might want to sniff the connection to see what's ... We downloaded and installed the Java SDK ... got from IBM. ... connect to the JDBC listener on the IBM, ...
    (comp.sys.hp.mpe)
  • Re: connecting to a database
    ... so I'm attempting to code it up in java. ... I have no idea how to set up a connection. ... connection to an Access Database that they would be willing to post. ... sql. ...
    (comp.lang.java.programmer)
  • Re: Spawning Server in Java
    ... You will not be able to achieve this using standard Java mechanisms. ... remaining option is to pass the descriptor yourself. ... need to create a unix domain socket connection between ... connection handling code in Java. ...
    (comp.lang.java.programmer)