Posts

Showing posts with the label JDBC

Tomcat JDBC Pool - Connection Leak - Catch the Culprit

Database connection leaks are something that can stay hidden unless paid specific attention and would come to the surface at the most critical stages at a peak time of the system. We would manually check if all the open connections have been closed properly. Then we have various code quality plugins that would scan and check for that. Still when the connections are passed through a complex structure of program both of these can miss a possible connection leak. Then at unit test or integration test levels, we can have checks to validate the counts in the connection pool to avoid this unfortunate situation, that would keep engineers busy at year-end, black Friday, etc. :) In the unfortunate case of hitting with a performance degrade or a total crash of the system which can be propagated via a JDBC connection leak, when we suspect a connection leak, how easily and quickly isolate the culprit. In the Tomcat connection pool, we can do this using 3 properties. removeAbandoned If a...

Deploying Identity Server over a JDBC Based User Store

Image
With this post I am to demonstrate how to configure WSO2 Identity Server with a JDBC user store. For the demonstration I am using a MySQL user store, but same procedure applies to any other JDBC user store as well. My environment is, OS - Ubuntu 12.10 Java - 1.6 WSO2 IS 4.5.0 Setting up MySQL database User Store Configuration in IS - Primary User Store Configuration in IS - Secondary (I am referring to extracted wso2is folder as CARBON_HOME in this post) Setting up MySQL database We need MySQL running at first. This post will be helpful in setting up the MySQL database , if it's not already done. Once MySQL is running we have to set up the database as required by the Identity Server. The server packs the necessary sql scripts within itself, which can be located at CARBON_HOME/dbscripts.  Let's login to MySQL server and execute the following, Create a database, mysql> create database JDBC_demo_user_store; Check out the creation, mysql> sho...

Getting Started with MySQL

Image
This is a simple beginners guide to use MySQL in linux, from installation to querying the databases. Installation Login Databases and tables Installation First let's make sure our package management tools are up-to date. For that run the following commands in command line. sudo apt-get update sudo apt-get dist-upgrade Once it finishes update and upgrading, we can install MySQL with following command. sudo apt-get install mysql-server mysql-client This will take a moment to install and now we are ready to go.  Login At first start up MySQL server is not set up with a password for root and we can login with, mysql -u root -p If we are setting the password for the first time we can use following to set-up, mysqladmin -u root -p NEWPASSWORD   If we want to change a previously set password following command can be used, mysqladmin -u root -p'oldpassword' password newpassword Databases and Tables First we should login to MySQL server with, mysql ...