Category: Development

Handling out of memory errors in Hotspot

The Hotspot compiler does not have an ExitOnOutOfMemoryError as the JRockit compiler does. You can simulate it on linux with something like what is below. We start with our test code that will ensure an out of memory condition… import…

Finding memory metrics in JBOSS

I can never remember how to do this, so this is just a placeholder for exposing memory utilization in JBOSS. c:\jboss-eap-5.1.2\jboss-eap-5.1\jboss-as\bin>twiddle.bat -u admin -p admin get jboss.system:type=ServerInfo | findstr Memory MaxMemory=3579183104 TotalMemory=3087007744 FreeMemory=2852457960 c:\jboss-eap-5.1.2\jboss-eap-5.1\jboss-as\bin>

Schema compare command line tool

I use what is below to quickly compare two Oracle database schema’s tables. It would be trivial to add indexes to the mix. import java.sql.*; import java.util.*; public class schemaDiffer { public static void main(String args[]) { try { Class.forName(“oracle.jdbc.driver.OracleDriver”);…

Print HTTP headers in ATG

ATG provides a class named InsertableServletImpl, which can do pretty much what it sounds like. You insert the servlet to be run in the ATG servlet pipeline where you dictate. This allows us to inject behavior into our application at…

JDBC and Oracle Database Change Notification

Below is a simple example of a cutdown example of using DCN in Oracle with JDBC. I plan on presenting this to our developers as an alternative to the ATG InventoryCache manager module. import java.sql.*; import java.util.*; import oracle.jdbc.*; import…

Finding java thread consuming CPU

Periodically, we will have an application server go to 100% CPU utilization on a single java process. Below is the methodology I use to troubleshoot a high CPU thread consumer in java. 1. As the user running the Java Virtual…

ApexSQL

We are currently migrating a given database environment from an external provider on SQL Server 2005 to Oracle 11.2.0.3. While we could use GoldenGate, it is a one time migration for which we don’t need the “big iron” (or cost).…