Question: i'm using the AxAcroPDFLib.AxAcroPDF Tool from the toolbox and am having it a specific PDF when i click a button. I have a separate button (button2) and Textbox which i want to use to automatically move the PDF page to the page number entered into the TextBox when button2 is pressed.

The following code isn't working and i'm not sure what code to use to get it to work (and no i cannot just use the tools inside the PDF reader to do this as i need all the controls on monitor 1 and the PDF is displayed on Montior 2, i've sorted this part):

KEY: dsm = form2 | pdfview = the PDF reader inside form2

```
dsm.pdfview.setCurrentPage(TextBox1.Text);

```

This isn't working. i've also tried:

```
dsm.pdfview.setCurrentPage = TextBox1.Text;

```

Also not working. Any help would be great! Thanks.

Answer: 
The question is old but for all those who have problems with Mongo DB JAVA driver timeouts : set the maxConnectionIdleTime property.

Example Spring Boot :

```
import com.mongodb.MongoClient;
import com.mongodb.MongoClientOptions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.mongo.MongoProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

import javax.annotation.PreDestroy;
import java.net.UnknownHostException;

@Configuration
@ConditionalOnClass(MongoClient.class)
@EnableConfigurationProperties(MongoProperties.class)
@ConditionalOnMissingBean(type = "org.springframework.data.mongodb.MongoDbFactory")
public class MongoAutoConfiguration {
    @Autowired
    private MongoProperties properties;

    @Autowired(required = false)
    private MongoClientOptions options;

    @Autowired
    private Environment environment;

    private MongoClient mongo;

    @PreDestroy
    public void close() {
        if (this.mongo != null) {
            this.mongo.close();
        }
    }

    @Bean
    @ConditionalOnMissingBean
    public MongoClient mongo() throws UnknownHostException {
        this.options = options.builder().maxConnectionIdleTime(1000 * 60 * 4).build();
        this.mongo = this.properties.createMongoClient(this.options, this.environment);
        return this.mongo;
    }
}

```

A very useful link here : [Java DriverJAVA-2535 com.mongodb.MongoSocketWriteException ......](https://jira.mongodb.org/browse/JAVA-2535)
I found the following document with a possible solution.

<https://www.programmersought.com/article/1927319190/>

It mentions the following:

```
spring.data.mongodb.address=172.16.250.234:27017,172.16.250.239:27017,172.16.250.240:27017
spring.data.mongodb.replica-set=rs0
spring.data.mongodb.database=test
spring.data.mongodb.username=admin
spring.data.mongodb.password=admin

# Configure spring.data.mongodbDB Pool
spring.data.mongodb.min-connections-per-host=10
spring.data.mongodb.max-connections-per-host=100
spring.data.mongodb.threads-allowed-to-block-for-connection-multiplier=5
spring.data.mongodb.server-selection-timeout=30000
spring.data.mongodb.max-wait-time=120000
spring.data.mongodb.max-connection-idel-time=0
spring.data.mongodb.max-connection-life-time=0
spring.data.mongodb.connect-timeout=10000
spring.data.mongodb.socket-timeout=0
spring.data.mongodb.socket-keep-alive=false
spring.data.mongodb.ssl-enabled=false
spring.data.mongodb.ssl-invalid-host-name-allowed=false
spring.data.mongodb.always-use-m-beans=false
spring.data.mongodb.heartbeat-socket-timeout=20000
spring.data.mongodb.heartbeat-connect-timeout=20000
spring.data.mongodb.min-heartbeat-frequency=500
spring.data.mongodb.heartbeat-frequency=10000
spring.data.mongodb.local-threshold=15
spring.data.mongodb.authentication-database=auth_dev

```

I'm trying to test this now to make sure it is working, but it at least seems plausible.