Friday, December 3, 2010
Hibernate shows SQL to log4j too
# Hibernate logging
# Log everything (a lot of information, but very useful for troubleshooting)
log4j.logger.org.hibernate=FATAL
# Log all SQL DML statements as they are executed
log4j.logger.org.hibernate.SQL=DEBUG
# Log all JDBC parameters
log4j.logger.org.hibernate.type=INHERITED
# Log all SQL DDL statements as they are executed
log4j.logger.org.hibernate.tool.hbm2ddl=INHERITED
# Log the state of all entities (max 20 entities) associated with the session at flush time
log4j.logger.org.hibernate.pretty=INHERITED
# Log all second-level cache activity
log4j.logger.org.hibernate.cache=INHERITED
# Log all OSCache activity - used by Hibernate
log4j.logger.com.opensymphony.oscache=INHERITED
# Log transaction related activity
log4j.logger.org.hibernate.transaction=INHERITED
# Log all JDBC resource acquisition
log4j.logger.org.hibernate.jdbc=INHERITED
# Log all JAAS authorization requests
log4j.logger.org.hibernate.secure=INHERITED
Monday, April 19, 2010
Oracle Query Analysis
set autotrace on exp;
Run Some SQL!
Elapsed: 00:00:00.01
Execution Plan
----------------------------------------------------------
Plan hash value: 1080733679
--------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 21 | 2 (0)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 21 | | |
| 2 | NESTED LOOPS | | 1 | 21 | 2 (0)| 00:00:01 |
|* 3 | TABLE ACCESS FULL| NG_FILES | 1 | 16 | 2 (0)| 00:00:01 |
|* 4 | INDEX UNIQUE SCAN| PK_NG_FILES_ID | 1 | 5 | 0 (0)| 00:00:01 |
--------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
3 - filter("DATE_FILE_RECEIVED">=TIMESTAMP' 2009-12-16 00:00:00' AND
"DATE_FILE_RECEIVED"<=TIMESTAMP' 2009-12-17 00:00:00')
4 - access("NG_FILE_ID"="NG_FILE_ID")
Thursday, April 1, 2010
Linux Commands
To examine a large log with logj4, STDIN, STDOUT, and STDERR printouts all going to the same log file, I find it easier to comb when I can narrow down to specific type(s) of log4j level statements and show them without line breaks.
grep "^\[TRACE\|DEBUG\|INFO\|ERROR\|WARN\|FATAL\]" my.log | less -SAlso, to recursively add files in your svn working copy...
svn status | grep "^\?" | awk '{print $2}' | xargs svn add
Friday, March 26, 2010
SVN Merging : Blocking Revisions
Blocking revisions from auto merging in svn, taken from the manual.
$ cd my-calc-branch
$ svn propget svn:mergeinfo .
/trunk:1680-3305
# Let's make the metadata list r3328 as already merged.
$ svn merge -c 3328 --record-only http://svn.example.com/repos/calc/trunk
$ svn status
M .
$ svn propget svn:mergeinfo .
/trunk:1680-3305,3328
$ svn commit -m "Block r3328 from being merged to the branch."
Friday, February 19, 2010
Debug tests in maven
If you need to configure a different port, you may pass a more detailed value. For example, the value below will use port 5334.
mvn -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5334" test
Note: if you are not worried about making a connection to the debugger so that you are connected before the program reaches your breakpoint, you can change suspend=y to suspend=n, and the tests will not wait for a debugger connection
Friday, October 30, 2009
Tuesday, October 13, 2009
Capturing Screenshots On Mac
Great tips for capturing screen shots on the Mac. I got this from..
http://www.techiecorner.com/138/how-to-do-print-screen-in-mac-os-x/
There are few ways to do screen capture in Mac OS X.
Follow the steps below and you will be able to do a screen capture in Mac OS X.
- Switch to the screen that you wan to to do screen capture
- Hold down Apple key ⌘ + Shift + 3 and release all
- then use your mouse to click on the screen
- Done. You will see a picture file in at your desktop. That’s the screen capture picture.
You can also do a screen capture for a portion of your screen.
- Switch to the screen that you wan to to do screen capture
- Hold down Apple key ⌘ + Shift + 4 and release all key
- Now, You will see the mouse cursor will change to +
- You can start to drag your mouse to select the portion you wish to capture.
- Once finish, you will see a picture file in at your desktop. That’s the screen capture picture!
If you want to do a screen capture for a particular application window, you can follow this:-
- Switch to the screen that you wan to to do screen capture
- Hold down Apple key ⌘ + Shift + 4 and release all key
- Now, You will see the mouse cursor will change to +
- Press the space bar once
- You will see the mouse cursor change to a camera
- Now you can use the camera to select which application window to screen capture
- Once finish, you will see a picture file in at your desktop. That’s the screen capture picture!