Skip to main content

Posts

Showing posts from 2010

High-Performance Oracle JDBC Programming

IMPORTANT NOTE : I'm not the author of this post. Ths original location is here : http://blog.csdn.net/hakunamatata2008/archive/2009/05/13/4175764.aspx

High-Performance Oracle JDBC Programming

Learn how to improve performance of Oracle-driven JDBC programs by leveraging connection and statement pooling features.

By Yuli Vasiliev

Published April 2009

Using pooling techniques such as connection pooling and statement pooling can significantly improve performance of database-intensive applications, because it enables the reuse of objects that would otherwise need to be created from scratch, at the expense of time and resources.

Reusing database connection objects representing physical database connections utilized by an application can result in significant performance gains, provided that the application interacts with the database intensively, frequently re-establishing connections with the same parameters. On the other hand, you won’t benefit from using a connection pool if your applicat…

Replace your C3P0 or DBCP by Oracle pool (UCP)

Introduction : ODS or UCP?
I've been using DBCP and C3P0 for a long time. But, a few months ago, I started to have problems with them. For example, sometimes, no way to get any connection to my database (while it's still possible with my Oracle SQL Developer). So, I decided to look at the code of C3P0. What a surprise! Even if it's a very common pool for a lot of projects (such as Hibernate), it seems to be dead. No more development, code complicated with sub projects, no Maven integration (...ok, ok, even if you hate Maven, you have to admit that it is very efficient to modify the code of mavenized projects...). Thus, I looked for a new pool. Of course, I found the recent tomcat jdbc pool. But I finally decided to work with Oracle pool just because I only have Oracle databases.

So, this post is my history with Oracle pool.

When you look for pool features on Oracle doc website, you find to ways to implement it :
Oracle DataSource pool (also called ODS) and included in the driv…

My AJP connector is sick!!!

Today, I had a problem between my Apache balancer and my Tomcat cluster. A virtual machine that was hosting two Tomcats was frozen. Something was wrong in my config and the Apache didn't show these Tomcats in error in the jk_status web interface. After a few minutes, I realized that the uriworkermap file was not configure on 'balancer' but directly on 'tomcat1' (one of the two Tomcats that were down).
So, I concluded that the Apache jk doesn't do any test on a worker if it isn't mapped with an uri.
But let'go back to my virtual machine that was frozen. It was not completely dead and a telnet 8010 was responding. Thus, my first conclusion was that I had a problem with my Apache. BAD WAY!!! The telnet was not efficient. I demonstrated that with a tiny perl script found on the net made to simulate an ajp ping.
You can use the script as this : time ./ajp_ping.pl server:8009
Many thanks to the author of this script. I don't have the link to his post anymor…

Tomcat and the web.xml's webapprootkey

I n my company, I have to deal with many Spring based applications deployed on a Tomcat cluster. For each one, we set a property 'webapprootkey' in the web.xml file to avoid errors on startup. Today, I decided to dig about that (... erratum... I decided to tell Google to dig about that). Thus, I found this excellent post.

http://groups.google.com/group/riotfamily/browse_thread/thread/9a0edf69575d3ab6?pli=1

Hi all,

when deploying two applications build from the riot skeleton within the same Tomcat servlet container, you get an IllegalStateException: Web app root system property already set to different value: 'webapp.root' = [/Users/joe/Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/webapp-A/] instead of [/Users/joe/Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/webapp-B/] - Choose unique values for the 'webAppRootKey' context-param in your web.xml files!

I will try to explain where this comes from and how …

How to fix mouse click problem on flash player 64 bits with Ubuntu 9.10

I just write here some informations I found on the web. On my Linux Ubuntu 9.10 64 bits, the flash plugin sometimes doesn't register mouse clicks. To fix it, edit the following file by doing :
sudo gedit /usr/lib/nspluginwrapper/noarch/npviewer
and add this export
export GDK_NATIVE_WINDOWS=1
like this
#!/bin/sh # # nsplugin viewer wrapper script... OS="`uname -s`" ARCH="`uname -m`" NPW_LIBDIR="/usr/lib/nspluginwrapper" export GDK_NATIVE_WINDOWS=1
if test -z "$TARGET_OS"; then ...
Enjoy!