Results 1 to 2 of 2

Thread: HTTP invoker concurrency questions

  1. #1
    Join Date
    Jul 2008
    Posts
    2

    Unhappy HTTP invoker concurrency questions

    Dears,
    I'm a new guy to the Spring, and now i plan to use the HTTPInvoker mechanism as a communication channel between two spring applications-Server and client, The Server may support multi-clients to get the exported service, I have no iead if the Same API/service export by Server can be called by multi-clients at the same time, and if have some issue like thread-safe.

    Anyone can help me about this?

    Thanks and Regards
    GUI

  2. #2
    Join Date
    Nov 2004
    Location
    Hilversum - The Netherlands
    Posts
    1,054

    Default

    If the same object is shared between threads, it needs to be threadsafe.

    Threadsafety in this case can be realized in different ways:
    - make your object immutable. In most cases service objects are immutable. All state is written to the database, and the database is responsible for isolating the transactions (with some help from the developer like setting the isolation level, select ... for update and optimistic locking).

    - add synchronization. In most cases this should be avoided because it is complex.

    The immutable approach in most cases is the best approach. So as long as your object is immutable, you don't need to worry about multithreading issues.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •