ProgramixGenericLib v5.0.1

com.programix.da
Class StaleDataException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.programix.da.StaleDataException
All Implemented Interfaces:
Serializable

public class StaleDataException
extends Exception

Used with Optimistic Concurrency Control to indicate that there has been an attempt to update a record with a stale version.

For example, assume that a shipping address record with an "update count" of 5 has been read by User A. While User A is editing this data, User B also reads version 5, edits the data, and then updates the record in the data store (and consequently the "update count" gets changed to 6). Now, when User A attempts to save his/her version of the record, the save fails by throwing a StaleDataException where getTarget() returns something like "shipping_address", getExpectedCount() returns 5, and getActualCount() returns 6. The textual message for StaleDataException also includes those three pieces of data.

Author:
Paul Hyde
See Also:
Serialized Form

Constructor Summary
StaleDataException()
           
StaleDataException(String message)
           
StaleDataException(String target, int expectedCount, int actualCount)
           
StaleDataException(String message, Throwable cause)
           
StaleDataException(Throwable cause)
           
 
Method Summary
 int getActualCount()
           
 int getExpectedCount()
           
 String getTarget()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StaleDataException

public StaleDataException(String target,
                          int expectedCount,
                          int actualCount)

StaleDataException

public StaleDataException()

StaleDataException

public StaleDataException(String message)

StaleDataException

public StaleDataException(String message,
                          Throwable cause)

StaleDataException

public StaleDataException(Throwable cause)
Method Detail

getTarget

public String getTarget()

getExpectedCount

public int getExpectedCount()

getActualCount

public int getActualCount()

ProgramixGenericLib v5.0.1

Copyright © 2001-2009 Programix Incorporated. All rights reserved. ProgramixGenericLib is free and is OSI Certified Open Source Software under the BSD license.