JDBC Tuning- Part 1

JDBC Tuning- Part 1

 

Before we start please note all R&D should be done in integration/staging environment and not in production , expectation is all bugs/app leaks are closed before you move to production.

Sometime (particularly when you have too large DB/too many DB connected to a single jBoss instance) jBoss throws   No Managed Connections available and timeout error.

This means that all connections to the database are saturated or a thread has timed-out waiting for a connection to open up. Now this could happen due to multiple reasons.

  1. Predominantly we forget to close connection in code

Solution- Stop leaking any open database connection in app. Go to $deploy/jbossjca-service.xml

and add  <attribute name="Debug">true</attribute>, this will allow jBoss to throw a message like

“Closing a statement you left open, please do your own housekeeping”

  1. Connection pool size

Solution- Increase your connection pool size in datasource file

<max-pool-size>20</max-pool-size>

(Default is 20)

  1. Thread time out

Solution- Increase thread wait time just add below script in  your datasource file

<blocking-timeout-millis>xxx</blocking-timeout-millis>

Note: xxx should be much more than timeout value

  1. Old JDBC Driver

Solution- update driver, it is a JAR file, download and copy into  JBoss  jboss-as/server/myinstance/lib

Happy Tuning :)

要查看或添加评论,请登录

Ron Sengupta的更多文章

  • Digital Asset Custodians in Securing Crypto

    Digital Asset Custodians in Securing Crypto

    As a longtime Crypto and (Crypto security) enthusiast, I was really interested when I came across news that Indian…

  • Cartesian theater

    Cartesian theater

    [ To Be Continued]

    2 条评论
  • Blockchain and DRM

    Blockchain and DRM

    Blockchain is a buzzword that’s thrown around a lot, especially when it comes to Digital Rights Management (DRM)…

  • Supply Chain Mgmt. Simulation in the Beer Pub

    Supply Chain Mgmt. Simulation in the Beer Pub

    The Role of Simulation in Supply Chain Management As per the “Supply Chain Management: Strategy, Planning, and…

  • Baseline(s)..

    Baseline(s)..

    Merriam-webster defines baseline "as a line serving as a basis", or you can think of it is a starting point used for…

  • Right to be forgotten

    Right to be forgotten

    I was researching “right to be forgotten” which you might also hear being called “the right to erasure," I am bit…

  • Sherlock Holmes, Observability and Chaos Engineering - Fun Story

    Sherlock Holmes, Observability and Chaos Engineering - Fun Story

    "Without observability, you don’t have ‘chaos engineering’. You just have chaos.

  • An Enterprise Platform Design

    An Enterprise Platform Design

    Enterprise Kubernetes(Openshift ) is the modern-day operating system for the cloud. It has a wide range of constructs…

  • End to end encryption with Openshift-Two-way-SSL

    End to end encryption with Openshift-Two-way-SSL

    This article aims to demonstrate use cases for Openshift routes to achieve end-to-end encryption. This is a desirable…

  • Harry Potter

    Harry Potter

    I wrote this almost ten years back in 2005, just before "Half blood prince" was published. There was a contest from a…

社区洞察

其他会员也浏览了