We run newrelic, which is an Advanced Performance Management (APM) software stack that will profile your java application from the browser all the way to the database. It is really good software, affordable, and highly recommended. I also wanted to…
Category: Java
Query AS400/iSeries from JDBC
We are migrating an in house system from the AS400 to Oracle, and I needed to look at the data in its “raw” format to assist with a migration plan. I ended up using JDBC rather than the GUI provided…
OutOfMemory error in one classloader
I thought this was interesting. If an OutOfMemory error (not exception, there is a difference) is thrown in one classloader when multiple class loaders are in use, it won’t cause the entire JVM to abort as it will when it…
Example of creating an order in ATG
I spent a lot of time understanding the plumbing of the Pipeline, OrderManager, etc. As I have indicated in the past, simple startup examples of ATG development are hard to find. The out of the box form handlers work far…
Simple byte code injection example with Javassist
This is a simple example that will time how long a method takes to execute, without changing the source code. First, we need to download the javassist software from http://www.javassist.org Please the javassist.jar file in your classpath. Also, set your…
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>
ATG custom property descriptor to change data upon retrieving and persisting property
While coming up with a soon to be posted simple example of using the ATG stack to create an order, I found that using the encrypted credit number stored in the DPS_USER_CREDIT_CARD table was not usable upon checkout, as it…
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…