Results 1 to 5 of 5

Thread: Are endpointinterceptors thead-safe?

  1. #1
    Join Date
    Jun 2008
    Posts
    21

    Default Are endpointinterceptors thead-safe?

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

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    The implementations must ensure they are threadsafe.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Nov 2007
    Posts
    122

    Default

    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
    {
    }

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Nov 2007
    Posts
    122

    Default

    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???

Posting Permissions

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