Discussions
Categories
- 385.5K All Categories
- 5.1K Data
- 2.5K Big Data Appliance
- 2.5K Data Science
- 453.4K Databases
- 223.2K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 47 Multilingual Engine
- 606 MySQL Community Space
- 486 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.2K ORDS, SODA & JSON in the Database
- 585 SQLcl
- 4K SQL Developer Data Modeler
- 188K SQL & PL/SQL
- 21.5K SQL Developer
- 46 Data Integration
- 46 GoldenGate
- 298.4K Development
- 4 Application Development
- 20 Developer Projects
- 166 Programming Languages
- 295K Development Tools
- 150 DevOps
- 3.1K QA/Testing
- 646.7K Java
- 37 Java Learning Subscription
- 37.1K Database Connectivity
- 201 Java Community Process
- 108 Java 25
- 22.2K Java APIs
- 138.3K Java Development Tools
- 165.4K Java EE (Java Enterprise Edition)
- 22 Java Essentials
- 176 Java 8 Questions
- 86K Java Programming
- 82 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 208 Java User Groups
- 25 JavaScript - Nashorn
- Programs
- 667 LiveLabs
- 41 Workshops
- 10.3K Software
- 6.7K Berkeley DB Family
- 3.6K JHeadstart
- 6K Other Languages
- 2.3K Chinese
- 207 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 474 Portuguese
How to configure a TCP Keep-alive in JDBC connection string

Hello,
I am using a JDBC connection string to connect to an oracle database, I am having idle connections because the response time is greater than 350 seg. therefore I am trying to add in the JDBC connection new network parameters but in my test identified that I have not sent a keep-alive packed I have doubts about the configuration, Could you help me with an example ?
My JDBC connection:
jdbc:oracle:thin:@(DESCRIPTION=(FAILOVER=on)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.4.50)(PORT=1522)))(CONNECT_DATA=(SERVICE_NAME=GTRPRSVCOS)))
New parameters:
ENABLE=BROKEN, SO_KEEPALIVE, TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT
jdbc:oracle:thin:@(DESCRIPTION=(FAILOVER=on)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.4.50)(PORT=1522)))(CONNECT_DATA=(SERVICE_NAME=GTRPRSVCOS))(ENABLE=BROKEN)(SO_KEEPALIVE=true)(TCP_KEEPIDLE=60)(TCP_KEEPINTVL=30)(TCP_KEEPCNT=15))
I appreciate your help,
Answers
-
Can you check out the KEEPALIVE connection parameters and their definitions and use the ones that are suitable for your requirement? Please look under 'Network Connection Properties' under OracleConnection.html
oracle.net.keepAlive Enables TCP keep alive
oracle.net.TCP_KEEPIDLE Specifies the amount of time for a connection to remain idle before sending keep alive probes
oracle.net.TCP_KEEPINTERVAL Specifies the frequency at which keep alive probes are retransmitted oracle.net.TCP_KEEPCOUNT Specifies the maximum number of keep alive probes to send before terminating the connection