Archive for March, 2010

What is the @Schedule annotation?

The @Schedule annotation is used to mark an enterprise bean method as a timeout method according to the calendar schedule specified in the attributes of @Schedule. This annotation has elements that correspond to the calendar expressions and the persistent, info, and timezone elements.

  • Share/Bookmark

What is the begin() method?

The begin() method creates a new transaction and associates it with the current thread. This method belongs to the UserTransaction interface. The general form of this method is as follows:

public abstract void begin() throws IllegalStateException

This method will throw an IllegalStateException if the thread is already associated with a transaction.

  • Share/Bookmark

What is getEJBLocalObject() method?

The getEJBLocalObject() method is used to obtain a reference to the EJB local object that is currently associated with the instance and can only be called by an instance of an entity enterprise Bean. The instance must be associated with an EJB local object identity, i.e. in the ejbActivate, ejbPassivate, ejbPostCreate, ejbRemove, ejbLoad, ejbStore, and business methods. An instance can use this method when it wants to pass a reference to itself in a method argument or a result. The general format of this method is as follows:

public EJBLocalObject getEJBLocalObject() throws java.lang.IllegalStateException

  • Share/Bookmark

The following table summarizes the differences between the Get and Post requests:


Get Request Post Request
Get is the default HTTP method.POST is not the default HTTP method.
It is triggered when the HTML
tag specifies a method=”GET”.
It is triggered when the HTML
tag specifies a method=”POST”.
Its target resource can be static or dynamic. Its target resource can be dynamic only.
The query string is appended as part of the URL after the “?” character. The query string is passed as part of the body, at the end of the request header.
It does not have a body. It has a body.
It is used for just retrieving data from a requested URL. It is used to update information.
It can be bookmarked. It cannot be bookmarked.

  • Share/Bookmark