Pages

Monday, May 23, 2011

A Guide to Log4j in JBoss

Every application needs to log various levels of information when the application is running. We can do this either through the application or also by server to do the logging. In this article we will see how we can work with log4j in JBoss. We use JBoss 5 as our server.The file for configuring the log4j in JBoss is available in JBOSS_HOME\server\<Server Instance>\conf\jboss-log4j.xml.the file defines a set of appender...
Read More

Thursday, May 19, 2011

Closing a ResultSet and PreparedStatement In JBoss

It is very important to close the Resultset and PreparedStatements that are opened while working with Database. These needs to be closed if we want to use PreparedStatementCache in our application Server.JBoss application servers provides us options in closing the ResultSet and PreparedStatement if we miss to close them. We need to add <track-statements>true</track-statements>To the Datasource-ds.xml files. This...
Read More

Detecting Connection Leaks In JBoss

Now a day’s applications need to access database in their daily operations. Accessing a database is quite a critical piece of functionality. In this article we will see how we can handle the connection leaks in our application using JBoss application server.Consider the sample servlet, public ArrayList<Connection> connectionList=new ArrayList<Connection>();      protected void doPost(HttpServletRequest...
Read More