Announcement Announcement Module
Collapse
No announcement yet.
Unreliable connection Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unreliable connection

    Hi all,

    I'm experimenting some difficulty with an application I've just developed.

    While in the development environment it worked fine, in the production machine I get the following exception now and then:

    21 ago 2007 12:23:05,099 ERROR: org.springframework.ldap.ServiceUnavailableExcepti on: 10.243.13.171:389; socket closed

    It seems that the connection to the ldap server is constrained by a timeout(the server sits behind a firewall actually). Nonetheless, if I try to resubmit the query soon after the first failure it succeeds.

    I was wondering whether one might specify the number of times a given operation should be attempted before reporting an exception.

    Thanks in advance for your help
    Fabio

  • #2
    it's me again!

    Just to post a solution which I am aware isn't exactly elegant! Please suggest something better!

    By the way, as it happens that sometimes it's difficult to establish a connection, before launching the real query I put a call to the following method:

    private void testConnection(){
    try {
    this.ldapTemplate.lookup(legacyBaseDN);
    } catch (RuntimeException e) {
    cat.info("Connection closed");
    }
    }
    Bye,
    Fabio

    Comment


    • #3
      Unfortunately there's no connection validation built-in in Java LDAP connection pooling. You should either turn pooling off in your ContextSource or set the pooling timeout very short (e.g. 2 seconds), either as system properties or in a base environment set on your ContextSource. See this page for details on pooling configuration.

      Comment


      • #4
        Hi Rasky,

        thanks very much for your reply: precise as usual!

        Fabio

        Comment

        Working...
        X