DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    John Decker Guest

    Isolation Problem (serializability)


    Hi,

    My Weblogic server is connecting to a remote (third party) machine using
    a SSLSocket.
    Through this socket connection, it sends a HTTP Post request and it listens
    for the answer.

    For each user in my Weblogic server, I need to send a HTTP Post request and
    listen for its
    corresponding answer (1 to 1 relationship).

    The socket is opened by a Bean contained in a JSP (with an application scope).

    Each user invokes the JSP page and uses this Bean.
    I'm afraid that when multiple users start invoking the JSP the requests and
    responses might get all mixed up. (You could call this a "Isolation or serializability"
    problem).

    How does the socket know that a specific response corresponds to a certain
    request (both associated to the same user) when multiple users are using
    the Bean?

    Does the EJB specification provide any way to achieve this?

    Thanks in advance for your ideas

  2. #2
    Kingshuk Guest

    Re: Isolation Problem (serializability)


    Hi John
    I did not understand whether you are using a java bean or an ejb.
    In both the cases however the easier solution is to provide a separate socket
    for each thread.

    So if its a java bean AND if you are using one single instance of the java
    bean for all requests then create the socket in the method ( instead of making
    it a member variable ) , thus making it visible only to the executing thread
    and no one else. Once you obtain the response , before returning from the
    method you will have to close the socket , so in this way there will be no
    problem of intermixed responses.


    If its an EJB , making it a stateless session bean is probably one solution
    . Every thread will invoke create a method to create the bean and then invoke
    the method , the method in turn will create the socket and the socket will
    be visible only to the currently executing thread , once again no problem
    with interleaving.

    Hope this helps

    Kingshuk



    "John Decker" <john@javacontractor.com> wrote:
    >
    >Hi,
    >
    >My Weblogic server is connecting to a remote (third party) machine using
    >a SSLSocket.
    >Through this socket connection, it sends a HTTP Post request and it listens
    >for the answer.
    >
    >For each user in my Weblogic server, I need to send a HTTP Post request

    and
    >listen for its
    >corresponding answer (1 to 1 relationship).
    >
    >The socket is opened by a Bean contained in a JSP (with an application scope).
    >
    >Each user invokes the JSP page and uses this Bean.
    >I'm afraid that when multiple users start invoking the JSP the requests

    and
    >responses might get all mixed up. (You could call this a "Isolation or serializability"
    >problem).
    >
    >How does the socket know that a specific response corresponds to a certain
    >request (both associated to the same user) when multiple users are using
    >the Bean?
    >
    >Does the EJB specification provide any way to achieve this?
    >
    >Thanks in advance for your ideas



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links