Q1:What is the of use caching in hibernate? Can we disable the first level cache?
Caching helps in reducing the hits over database.First level cache cannot be disabled but by using evict() we can make hibernate to fetch the entity everytime from db

  1. First level cache is associated with “session” object and other session objects in application can not see it.
  2. The scope of cache objects is of session. Once session is closed, cached objects are gone forever.
  3. First level cache is enabled by default and you can not disable it.
  4. When we query an entity first time, it is retrieved from database and stored in first level cache associated with hibernate session.
  5. If we query same object again with same session object, it will be loaded from cache and no sql query will be executed.
  6. The loaded entity can be removed from session using evict() method. The next loading of this entity will again make a database call if it has been removed using evict() method.
  7. The whole session cache can be removed using clear() method. It will remove all the entities stored in cache.

You should therefor either use the evict() or clear() method to force a query to the database.

Please Refer here

Q2:What is automatic dirty checking in hibernate?
Whenever an entity is loaded through hibernate, it makes an additional copy of that whole entity object along with the all entity’s property values. By entity, we mean each persistent object of that entity type. Within the Persistence Context, Hibernate has a copy of all persistent objects that were loaded from the database. It compares these persistent objects with these objects to detect the objects that have been modified or are dirty. This is the default implementation.
Please Refer here

In javascript date validation, while checking selected date is less than or equal to today’s date, time should be taken into consideration otherwise even when the selected day is equal to today’s date the validation fails.


 var strStartDate          = $("selectedStartDate").val();
 var strStartDateFormatted = new Date(strStartDate);
 var today                 = new Date();

  if(strStartDateFormatted == today)
    console.log("Both are Same");

new Date() will return date with time where as date returned using the datepicker does not contain time so if you directly compare new Date() which comes along with time it would return false even when the date-month-year are equal.

Date.prototype.withoutTime = function () {
    var d = new Date(this);
    d.setHours(0, 0, 0, 0);
    return d;

var date1 = new Date(2014,1,1);
new Date().withoutTime() > date1.withoutTime(); // true

WS-Addressing is useful in situations where the SOAP response can’t be served immediately. Either the resources to form the response are not available right away or the result itself takes a long time to be generated. There are times where your business takes time.something which needs manually intervention, something to be approved, whatever, but it takes days to do it. keeping the connection opened all that time and waiting for the response would be inefficient.notification process comes to rescue in these kind of scenarios.The client makes a requests but does not wait for the response. It instead instructs the server where to send the response by use of a “reply to” address. Once the response is available, the server connects to that address and sends the response.Instead of relying on network-level transport to convey routing information, a message utilizing WS-Addressing may contain its own dispatch metadata in a standardized SOAP header.WS-Addressing you are not tied to that. You can demand the response on another type of channel. Request comes on HTTP for example, but you can instruct the server to send the response back over SMTP, for example.

Coach Sleeper Class NON-AC COACH (ICF)

Coach Postion


  1. While booking tickets book lower berth tickets which is easy to exchange with others
  2. Make sure the lower berth tickets are booked and the lower berth tickets should be booked
    with people who will not cancel tour at any cost because once they drop it would get assigned to senior citizens who may dampen your plan
  3. If there is more than 300 tickets left in a train try to book 3 lower, 3 middle so you can get all the seats in the cabin
  4. While booking tickets book when all tickets are available in same coach takes precedence to preferred coach
  5. If a person is holding a confirmed ticket and is unable to travel, then the ticket can be transferred to his/her family members including father, mother, brother, sister, son, daughter, husband or wife, not to the friend.For transfer of ticket, an application must be submitted at least 24 hours in advance of the scheduled departure of the train to chief reservation supervisor with ID proof.

What is Template Pattern?
Template pattern, an abstract class exposes a ways to execute its methods. The subclasses can override the method implementation as per need but the invocation is to be in the same way as defined by an abstract class

When to use Template Pattern?

  1. When behaviour of an algorithm can vary, you let subclasses implement the behaviour through overriding
  2. You want to avoid code duplication, implementing variations of the algorithm in subclasses
  3. You want to control the point that subclassing is allowed.

System Path is one which comes when you type cmd in windows->run
Other simple commands are dir,ver,cls

Storing Variable Name

>>set strName=Mugil
>>echo  %strName%

Typing set and pressing enter will return system variable


To check for List of Users type

>>set USER

String Cancatenation

>>set strFirstName=Mugil
>>set strFirstName=%strFirstName% Vannan

Displays Volumne Info

>>vol D:
>>dir /B

Get option of Util
>>dir /?
>>cls /?

Lists folder in Dir with details


Lists folder in Dir without details

>>dir /B

Turn off the command executed in Screen

>>echo off

Turn off the Display of Batch Statements when Echo off command activated(Works for Script)

>>@echo off

/A tag will allow us to work with mathematical operation

>>Set /A

/P tag will allow user inputs by prompting msg

>>Set /P

Getting Inputs from Console

@echo off

set /p name=Please Enter your name

echo Your name is - %name%


Labels(Organize code pieces)


Goto(Jumps to Label and starts execution)

goto :label


rem this is comment
:: this is again a comment


   echo The Sum is Addition of Two Numbers
goto :eof	 

Calling Functions within function

	echo Calling Sum Function
	call :getSum	
goto :eof

   echo The Sum is Addition of Two Numbers
goto :eof	 

Functions that takes Argument

Maven is a “build management framework”

You could define how your .java files get compiled to .class, packaged into .jar (or .war or .ear) files, (pre/post)processed with tools, managing your CLASSPATH, and all others sorts of tasks that are required to build your project.

 Though it doesn’t give fine grain control like  Apache Ant or Gradle or Makefiles in C/C++, but it attempts to be completely self-contained in it that you shouldn’t need any additional tools or scripts by incorporating other common tasks like downloading & installing necessary libraries etc.

It is also designed to around “build portability” so that you don’t get issues as having the same code with the same buildscript working on one computer but not on another one (this is a known issue, we have VMs of Windows 98 machines since we couldn’t get some of our Delphi applications compiling anywhere else). Because of this, it is also the best way to work on a project between people who use different IDEs since IDE-generated Ant scripts are hard to import into other IDEs, but all IDEs nowadays understand and support Maven.

There are few inflexibility in maven and some developers stick with Ant or similar, but a growing number of them are people who have moved on to Maven successors such as Gradle and Buildr. These successors inherit from Maven the idea of providing a powerful set of build steps out of the box, but make it immensely easier to add custom steps too.