Tuesday, 11 January 2011

Why HibernateSession.flush()


Reference:

http://docs.jboss.org/hibernate/core/3.3/reference/en/html/objectstate.html#objectstate-flushing

Default behavior:

Flushing the session forces Hibernate to synchronize the in-memory state of the session with the database but does not commit the changes to database.

Usage:


  • To force database validation (database constraints) and handle the error no need to wait until commit
  • To check duplicate (Force the row to be inserted)
  • To get an assigned id
  • To update the size of session

Wednesday, 1 December 2010

Eclipse Maven

Set eclipse work space:

mvn -Declipse.workspace="your Eclipse Workspace" eclipse:configure-workspace
mvn -Declipse.workspace="your Eclipse Workspace" eclipse:add-maven-repo
mvn -Declipse.workspace=D:\eclipse-ws\20120229 eclipse:add-maven-repo
mvn -Declipse.workspace=D:\eclipse-ws\20120229 eclipse:configure-workspace

Create eclipse project resource files:

mvn ecliplse:clean
mvn ecliplse:eclise


Run Single test class or method:

mvn test -Dtest=ClassName
mvn test -Dtest=ClassName#methodName

mvn test -Dtest=com.gwt.server.service.CertServTest
mvn test -Dtest=com.gwt.server.service.CertServTest#testCertDetail


Running a Single Test


Friday, 11 June 2010

Friday, 16 April 2010

Linux/Unix Cheat Sheet

http://www.redhat.com/docs/manuals/linux/RHL-6.2-Manual/getting-started-guide/ch-doslinux.html

Tuesday, 15 December 2009

Maven


Apache Maven

Setup maven:

  1. Create a JAVA_HOME system variable.
  2. Create an M2_HOME system variable.
  3. Add %JAVA_HOME%\bin;%M2_HOME%\bin; to your system path.
  4. (Optional) Create a %MAVEN_OPTS% system variable. This variable name specified as java options in mvn.bat and mvn.sh. "-Xms512m -Xmx6024m"

Set configurations:

Configuration file (setting.xml) cab be found in two places:

  • The Maven install: $M2_HOME/conf/settings.xml (Global setting)
  • A user’s install: ${user.home}/.m2/settings.xml (User setting)

If both files configured then configuration in both will be merged and user setting will override global setting. 

Set the location for local maven repository:

Default local repository configuration details in setting.xml.

 

Include the following to entry to point to the local repository C:/maven/m2repository


/maven/m2repository