Monday, June 22, 2015

Understanding Data Sources and Connection Pool in Weblogic

Terms like datasources and connection pools are very familiar to weblogic developers and admins.

Most of the times developer ask for datasource creation on weblogic servers. Developers or admins who have worked on Oracle Application server also will be familiar with these terms. Newbies often get confused about these and the difference between the two.


In simple terms Applications deployed on weblogic servers(managed servers) use the datasources( created on Weblogic server level) to connect to the databases.


Though the connection can be made at the deployed code level(JDBC connect strings) Data sources and their connection pools provide connection management processes that help keep your system running and performant.You can set options in the data source to suit your applications and your environment.


I explain the concepts in more details below:




Data Sources


In WebLogic Server, you configure database connectivity by adding data sources to your WebLogic domain. WebLogic JDBC data sources provide database access and database connection management. Each data source contains a pool of database connections that are created when the data source is created and at server startup. Applications reserve a database connection from the data source by looking up the data source on the JNDI tree or in the local application context and

then calling getConnection(). When finished with the connection, the application should call connection.close() as early as possible, which returns the database connection to the pool for other applications to use.


Connection Pool


Each JDBC data source has a pool of JDBC connections that are created when the data source is deployed or at server startup. Applications use a connection from the pool then return it when

finished using the connection. Connection pooling enhances performance of the application server or deployed application response time by eliminating the costly task of creating database connections for the application.


Hope the above post helps. In future posts I would write on how to create connection pools in Weblogic and more importantly tuning them.

No comments:

Post a Comment