Announcement Announcement Module
Collapse
No announcement yet.
Are endpointinterceptors thead-safe? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Are endpointinterceptors thead-safe?

    Are EndpointInterceptor to be thread-safe? Or should the implementations ensure that they are thread-safe?

  • #2
    The implementations must ensure they are threadsafe.

    Comment


    • #3
      Below is the example of my end point using annotations, isn't it thread safe?

      @Endpoint
      public class MyMarshallingEndpointEndpoint
      {

      private static SimpleDateFormat yyyyMMddHHmmDF = new SimpleDateFormat("yyyy-MM-dd");
      private DataAcces access;


      @PayloadRoot(localPart = REQUEST_MESSAGE, namespace = "client")
      public ResponseMessage invoice(RequestMessage request) throws WebServiceRunTimeException
      {
      }

      Comment


      • #4
        Please use [ code][/code ] tags when posting code.

        Is it thread safe no because a SimpleDataFormat isn't thread safe. So you would need to recreate it each time. Next to that I have no idea because there is no code.

        Comment


        • #5
          I have fixed SimpleDateFormat to eliminate thread safe probleb, But we are getting nullPointerExceptions in production when multuple requests were sent over.

          It looks like a there is a threading issue.


          I am injecting data Access class which extends JpaDaoSupport

          Data Access class does this

          public class JpaDataAccess extends JpaDaoSupport implements DatAccess

          @Transactional
          public void addClientData(Client client) throws DataAccessException
          {
          getJpaTemplate().persist(client);
          getJpaTemplate().flush();
          }
          Is Jaxb thread safe I am using for marshalling and unmarshallling??
          Is JpaDaoSupport thread Safe???

          Comment

          Working...
          X