Weblogic doesn't override the equals() method on either the Local or Clustered Timerhandle implementation. (Doc ID 1177633.1)

Last updated on FEBRUARY 22, 2017

Applies to:

Oracle Weblogic Server - Version: 10.3 and later   [Release: and later ]
Information in this document applies to any platform.

Symptoms

When using WebLogic 10.3 you will notice that WebLogic doesn't implements equals() and hashCode() methods and you would like to know if there is any other manner in which to check that the retrieved 'TimerHandle' object is the same one as timer.getHandle()?

Explanation on this scenario:
By creating EJB Timer, you may have saved the 'TimerHandle' object for later use in Database along with specific name as a key for retrieving the object.
Then when the object is needed you need to check if the saved 'TimerHandle' is the same as passed 'Timer' object as per the below code.

@Timeout
public void execute( final Timer timer ) {
  // getting key from passed object in timer.getInfo().
  // getting saved timerhandle by key. let's say dao.getXxxHandle(key);
  // perform checking.
  if ( timerHandle != null && timerHandle.equals( timer.getHandle() ) ) {
    // do sth.
  }
  else {
    //do another thing.
  }
}

In the above code the focus always passes to the else block.
This works perfectly fine on WAS7 and JBoss4xx.
Seems like the issue happens on WebLogic as it doesn't seem to implement equals and hashCode methods. If this is true is there any other way to check that the retrieved TimerHandle is the same one as timer.getHandle()?

Changes

N/A

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms