This is just a quick snippet that shows how you can print all property values for a given ItemDescriptor. In this case, I wanted to print the properties for a given product id in the ProductCatalog repository. try { GSARepository…
Author: Steve
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>
Printing counts of page requests
Simple post today, this just strips the request parameter string of a URL recorded in the Apache style log, and groups the times each base page was requested in sorted order. -bash-4.1$ grep -v login /opt/jboss/versions/jboss-eap-5.1/jboss-as/server/q_ecm_01/log/localhost_access_log.2012-12-12.log | grep jsp |…
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…
Add BCC admin user with SQL
I was having an issue using my AD account to log into the BCC in the load test environment. In production, we have deleted the admin account for security reasons. This forces users to use their LDAP credentials, which is…
Quick way to trace a session on a server
If you identify an Oracle database process consuming a high amount of CPU, or want to trace it for any reason, you can simply run the following script and pass the PID of the offending process when requested. begin for…
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”);…