Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Real-Time Decisions
11g Release 1 (11.1.1)

E17787-01


com.sigmadynamics.server.DataServices.DatabaseProvider
Class DefaultDeadlockHandler

java.lang.Object
  extended by com.sigmadynamics.server.DataServices.DatabaseProvider.DefaultDeadlockHandler

All Implemented Interfaces:
DeadlockHandler

public class DefaultDeadlockHandler
extends java.lang.Object
implements DeadlockHandler

Constructor Summary
DefaultDeadlockHandler()
           

 

Method Summary
 void clear()
           
 java.sql.SQLException deadlockCheck(java.sql.SQLException e)
          This method checks to see whether an exception is for a deadlock.
 java.sql.SQLException getDeadlockException()
           
 int getRetryCount()
           
 boolean isDeadlockException(java.sql.SQLException e)
           

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

DefaultDeadlockHandler

public DefaultDeadlockHandler()

Method Detail

isDeadlockException

public boolean isDeadlockException(java.sql.SQLException e)
Specified by:
isDeadlockException in interface DeadlockHandler

clear

public void clear()
Specified by:
clear in interface DeadlockHandler

getRetryCount

public int getRetryCount()
Specified by:
getRetryCount in interface DeadlockHandler

getDeadlockException

public java.sql.SQLException getDeadlockException()
Specified by:
getDeadlockException in interface DeadlockHandler
Returns:
Returns the deadlock exception if any

deadlockCheck

public java.sql.SQLException deadlockCheck(java.sql.SQLException e)
This method checks to see whether an exception is for a deadlock. If it isn't, then it just returns the exception. If it is for a deadlock, then it checks whether the number of retries has reached the maximum and, if so, returns the exception. If it still wants to retry, then it does any sleeping that it's going to do and then returns a null.

It is important that the caller either calls clear when the original operation has succeeded or if it receives an exception for which it doesn't call this method so that the count value is reset properly.

Specified by:
deadlockCheck in interface DeadlockHandler
Parameters:
e - the original exception that should be checked
Returns:
Either an exception that the caller will probably throw or null to indicate that it was a deadlock exception and the caller should retry the operation.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Real-Time Decisions
11g Release 1 (11.1.1)

E17787-01


Copyright © 2010, Oracle. All rights reserved.