cktechnical
Monday, April 25, 2005
 
Hibernate DB Generation From Mapping Files
I use AppFuse to develop my Web Applications. So, I allow my Hibernate mapping files to generate my database for me. I always wanted to know how to get Hibernate to generate a TEXT field in MySQL. I have to type in: length="2147483647" in my mapping for a TEXT field. The answer can also be found in the Hibernate Documentation on the Hibernate website.
Wednesday, April 20, 2005
 
JasperReports printwhenexpression Print When Expression
I use JasperAssistant for my JasperReports and I was trying my darndest to make a Double field on my report not print when it was zero.
I of course started playing with the Print When Expression field available when you select a field test field on your report and click properties. I could not figure out what the Expression should be and what it should return. I was getting very frustrated. I started looking on the Web and couldn't find anything to help me with my Expression.
I started looking at the errors very carefully and discovered that the Expression needs to return a Boolean object. So I started my expression off with new Boolean( ) .
Then I worked on my expression. My field is of type Double so I had to say that
new Boolean( ($V{minimum}).doubleValue() > (new Double(0)).doubleValue() ).
This worked... and I was happy.

I got some help from the following site.
http://www.eclipseplugincentral.com/PNphpBB2+file-viewtopic-t-1433.html
Thursday, April 14, 2005
 
Checking IBM DB2 Connect's Version Number
Preface: I work in the Windows world.

Checking the version number on an installed DB2 Connect seems like it would be a really easy task. Pull up the HELP screen in any of the programs that ship with IBM DB2 Connect and "Voila!" you have your version number.

Doesn't work that way. We get the primary version number on the HELP screens (e.g. 7, 8, etc.) but we don't get the full version number (e.g. 7.01.00.40) which is what we want when we are trying to duplicate our development environment here at work. IBM Db2 Connect is upgraded about twice a day so keeping accurate track of the version numbers is very important. We get a shipment of disks about every other month with a new version number (Version 7.01.00.03 becomes Version 7.01.00.04).

To get the full version number you must go to the Windows Control Panel on an XP box and pull up Administrative Tools. Then click on the Data Sources (ODBC) shortcut. This will pull up the ODBC Data Source Administrator and you can go to the Drivers tab and scroll until you find the IBM DB2 ODBC Driver. Here you can view the Version in its entirety. You can then match this Version number with the Version number on the mountain of disks you have from IBM.

Wednesday, April 13, 2005
 
We Got a HeapDump!
We have had a few heapdumps on our Websphere Application Server 5.1 and I am trying to debug the problem.

The first thing I did was read up on the HeapDump itself on the IBM website. The article looks at Memory Leaks and gives you a few options on how to debug the application in error. I chose to use HeapRoots to analyze the HeapDumps. The article indicated that this was the most popular choice.
I downloaded the HeapRoots JAR file from the HeapRoots website and followed the instructions on how to begin analyzing a HeapDump.
A few notes to myself are needed here (feel free to ignore them):
I ran the HeapRoots analyzer and analyzed the heapAnalysis.txt file. What I found out is that I had an array object that had 21,000+ instances before the dump occurred. That is all I had. Time to dig deeper.

I checked out a thread on WebServerTalk that discusses HeapDumps in Webphere Application Server. In the thread I read about a setting called "verbosegc" that can be set on the Websphere Application Server so that you can monitor Garbage Collection on the server on a Windows box in the native_stderr.log file.

I started down the path of trying to figure out how to set the "verbosegc" setting on my Webphere Application Server. I found the following article on the Webphere website. I have set the setting on my Webphere Application Server and now I am in hover mode while I monitor the Garbage Collection process in the native_stderr.log file.
For in-server Java code, you can turn on tracing for the Java garbage collector by setting the verboseGC server property to true. The trace output describes how often the garbage collector runs, how long it takes, and what objects are deallocated. For information on the encoding of the output, see the documentation for the JDK version that you are running the server with.
I am also going to take a look at HeapAnalyzer that is also mentioned in the
WebServerTalk thread.


Powered by Blogger